3 ms·
Ah, but just because glibc doesn't call the fork() system call doesn't mean the kernel doesn't have one. :) I bet you could still get to by calling something l
by tedunangst 16y ago
Ah, but just because glibc doesn't call the fork() system call doesn't mean the kernel doesn't have one. :) I bet you could still get to by calling something like __glibc_old_fork(), or at the very least a manual syscall(SYS_FORK) should work.
POSIX itself doesn't even use the words system call, only function, to describe them.
- andrewvc 16y agoYep: $ grep fork /usr/include/asm/unistd_64.h #define __NR_fork 57 __SYSCALL(__NR_fork, stub_fork) #define __NR_vfork 58 __SYSCALL(__NR_vfork, stub_vfork) $ strace -f ruby -e 'syscall 57' 2>&1 | egrep 'fork|clone' fork(Process 4138 attached (waiting for parent) $ strace -f ruby -e 'fork' 2>&1 | egrep 'fork|clone' execve("/home/andrew/.rvm/rubies/ree-1.8.7-2010.02/bin/ruby", ["ruby", "-e", "fork"], [/* 47 vars */]) = 0 clone(Process 4145 attached