summaryrefslogtreecommitdiffstats
path: root/sys/kern/syscalls.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2007-07-04 22:47:37 +0000
committerpeter <peter@FreeBSD.org>2007-07-04 22:47:37 +0000
commitf69e26042aa742055e02b6ddcf5325115a8ac518 (patch)
treea4eea3a4d88ac006f809342c32362c147e23030d /sys/kern/syscalls.c
parent33b2e41038256d78b34e48d199524572f76c91d9 (diff)
downloadFreeBSD-src-f69e26042aa742055e02b6ddcf5325115a8ac518.zip
FreeBSD-src-f69e26042aa742055e02b6ddcf5325115a8ac518.tar.gz
Create new syscalls for mmap(), lseek(), pread(), pwrite(), truncate() and
ftruncate(), but without the pad arg. There are several reasons for this. Consider 'mmap()'. On AMD64, the function call (and syscall) ABI allow for 6 register arguments. Additional arguments go on the stack. mmap(2) has 6 arguments. However, the syscall definition has an extra 'int pad' argument. This pushes it to 7 arguments, which means one must spill into the memory stack. Since the kernel API doesn't match userland API, we have a hack in libc - libc/sys/mmap.c. This implements the userland API by calling __syscall() with an extra argument and the pad argument, for a total of 8 args. This is all unnecessary and inconvenient for several things, including the kernel's syscall handler code which now has to handle merging stack arguments with register arguments. It is a big deal for certain 3rd party code. I'm adding libc glue to make the transition totally painless. I had intended to mark the old syscalls as COMPAT6, but the potential to shoot your feet by building a new kernel without COMPAT_FREEBSD6 but with a slighly older userland was too great. For now, they have manual "freebsd6_" prefixes rather than being COMPAT6. They will go back to being marked 'COMPAT6' after 7-stable starts. Approved by: re (kensmith)
Diffstat (limited to 'sys/kern/syscalls.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud