diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2021-12-23 18:50:34 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2021-12-23 18:50:34 +0000 |
commit | 5d8c8d969184612e68d66305dcfb6301593fd5a6 (patch) | |
tree | 2d2f27ca6a453314dc3f8f60804609bd242bf088 /usr.sbin/ospfctl | |
parent | 400f5fa45fbb01e26f1de58370473241bef85589 (diff) |
Roll the syscalls that have an off_t argument to remove the explicit padding.
Switch libc and ld.so to the generic stubs for these calls.
WARNING: reboot to updated kernel before installing libc or ld.so!
Time for a story...
When gcc (back in 1.x days) first implemented long long, it didn't (always)
pass 64bit arguments in 'aligned' registers/stack slots, with the result that
argument offsets didn't match structure offsets. This affected the nine system
calls that pass off_t arguments:
ftruncate lseek mmap mquery pread preadv pwrite pwritev truncate
To avoid having to do custom ASM wrappers for those, BSD put an explicit pad
argument in so that the off_t argument would always start on a even slot and
thus be naturally aligned. Thus those odd wrappers in lib/libc/sys/ that use
__syscall() and pass an extra '0' argument.
The ABIs for different CPUs eventually settled how things should be passed on
each and gcc 2.x followed them. The only arch now where it helps is landisk,
which needs to skip the last argument register if it would be the first half of
a 64bit argument. So: add new syscalls without the pad argument and on landisk
do that skipping directly in the syscall handler in the kernel. Keep compat
support for the existing syscalls long enough for the transition.
ok deraadt@
Diffstat (limited to 'usr.sbin/ospfctl')
0 files changed, 0 insertions, 0 deletions