Thanks, this should help.
I just need some clerification though:
Code:
#include
#include
#include
#include
main(int argc, char **argv, char **envp) {
pid_t me, a;
me = fork();
if (!me) {
printf("Child process about to execve() a shell...\n");
printf("Type 'exit' to leave\n");
if (execve("/bin/bash", argv, envp)) {
printf("Error condition %d.\n", errno); }
else { a = waitpid(me, NULL, 0); printf("Parent process done.\n"); } }
Why doesnt it show the includes?
Can I do other things until the fork ends?