Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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 have a small question to all really great linux users and administrators. i couldn't understand the following program. can u please explain in short and in easy way. The program is
------------------------------------------------------------------
#include <sys/wait.h>
#define NULL 0
int main (void)
{
if (fork() == 0){ /* This is the child process */
execve("child",NULL,NULL);
/*
execvp("./Child",NULL);
exit(0);
*/
//printf("I am child process\n");
//exit(0);
}
}
------------------------------------------------------------------------
where i did not understand is
1) what is execve("child",NULL,NULL);
2)from --> Sleep(5) TO THE END,I DID NOT UNDERSTAND.
Can anybody help me please. its not tough for u greats but if u explain me,i would be more than blessed. Thanks.
First, as Nylex stated, Please use better thread titles than "Please Help". There should be something relating to the thread topic, in this case something like "query with routine in small program - HOMEWORK"
Second, when posting code please enclose it with the CODE tags (by clicking on the # symbol on the Post Thread/Reply to Thread dialogue box) this makes it so much easier to read as it keeps the formating.
Third, please state what you have tried already (including google searches)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.