ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I searched the internet and books and realised that
system() function is related to sh -c call. Maybe this is why my sh PID is so large and continues to grow larger.
I am using system() to kick start running my 3 c.programs. This is what I did.
The PID of test1, test2 and test3 are OK. But the
PID of sh is extremely big. Could someone please
teach me how to start running test1, test2 and test3 programs using system() with sh PID growing or some other ways to start running test1, test2 and test3??
The numeric value of a PID ("1012" vs "100025") has no significance: don't worry about it.
Your previous post was about accidentally running "system()" in an infinite loop, inadvertantly spawning an excessive #/processes. That's bad. What PID a particular process is - it's not a problem!
To kjordan:
I am suspecting my unit to be rebooted due to the large and growing PID of any process. The
pid has become 12447 for the top command, which means one of the processes PID keeps increasing. It should be the sh command. Will this be harmful to my unit like causing it to be rebooted??
To paulsm4,
Thanks for coming to my rescue again. Yeah, my previous post has been solved thanks to your advises. But now I am worried about the sh PID. :-(
I am a newbie in linux and worried that the way I
use system() is incorrect, causing the sh -c to have
increasingly large PID.
Could you all give me more advises!! Thank you very much!! Appreciate your great help!!
Distribution: LFS, I felt the itch and scratched it
Posts: 227
Rep:
How could any PID number be harmful to your computer? It's just a number to identify your process to any other process. I doubt there's any incorrect way to call system(); since it's just the name of the executable you want to execute. Don't worry about it, I've seen process numbers in the 20000's before I think. It's just a number assigned to it by the kernel.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.