Answers for "linux sleep process"

0

linux sleep with exec /bin/sleep

int pid= fork();
if (pid==0) { // child
	execl("/bin/sleep", "sleep", argv[1], NULL); // argv[1] is the sleeptime
    perror("execl");
    return EXIT_FAILURE;
}
if (waitpid(pid,NULL,0)<0) {
	perror("waitpid");
    return EXIT_FAILURE;
}
Posted by: Guest on November-21-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language