Way cool
- From: "Bill Cunningham" <nospam@xxxxxxxxx>
- Date: Wed, 23 Apr 2008 01:40:54 GMT
I don't know what this little program is doing but it's fun to watch.
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
main() {
int fd[2],num;
pid_t id;
id=num;
printf("%i",num);
pipe(fd);
id=vfork();
if(id==0) {
printf("success\n");
printf("%i",num);
}
close(fd[1]);
close(fd[0]);
return 0;
}
I wonder what the numbers that are changing is? The number that doesn't
change must be the process id.
Bill
.
- Follow-Ups:
- Re: Way cool
- From: Josef Moellers
- Re: Way cool
- Prev by Date: Re: syscall reference
- Next by Date: Re: syscall reference
- Previous by thread: OSDI '08 Call For Papers Deadline Approaching
- Next by thread: Re: Way cool
- Index(es):