News for hackers. Stuff that matters.
Re:If everything in Unix development is POSIX, what the hell... by tedunangst on Sunday January 02, 2011 @12:14PM (#2060413)
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.

Re:If everything in Unix development is POSIX, what the hell... by andrewvc on Sunday January 02, 2011 @12:37PM (#2060476)
Yep:

  $ 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