Comment 11 for bug 339743

Revision history for this message
Anders Kaseorg (andersk) wrote :

Kernels starting with 2.6.27 do not have that particular problem with popen() because they implement the pipe2() system call, so popen() does not tickle the missing syscall detection bug. But the attached source can be used to reproduce the missing syscall detection bug directly, by displaying the return value of syscall(6666666).

There are likely to be more and more problems arising from this bug as new syscalls get implemented.

To reproduce, statically compile this on an Intrepid or Jaunty i386 system:
  gcc -static bad-syscall-test.c -o bad-syscall-test
and then run the resulting binary on an Intrepid or Jaunty amd64 system.

Correct output:
  $ uname -rm
  2.6.24-etchnhalf.1-amd64 x86_64
  $ ./bad-syscall-test
  syscall(6666666) returned -1
  errno is 38 (Function not implemented)
Incorrect output:
  $ uname -rm
  2.6.28-8-generic x86_64
  $ ./bad-syscall-test
  syscall(6666666) returned 6666666
  errno is 0 (Success)