diff options
author | kib <kib@FreeBSD.org> | 2011-04-01 11:16:29 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2011-04-01 11:16:29 +0000 |
commit | 7c2eaa21fe792c26e223a2f36a4f5c00fdaf52d8 (patch) | |
tree | 601aa0131bd58a0facc71b1b7c7b138597686fbe /sys/kern/vfs_syscalls.c | |
parent | 6d6007bc145d7665435f03f2ff2043e14240d09e (diff) | |
download | FreeBSD-src-7c2eaa21fe792c26e223a2f36a4f5c00fdaf52d8.zip FreeBSD-src-7c2eaa21fe792c26e223a2f36a4f5c00fdaf52d8.tar.gz |
Add support for executing the FreeBSD 1/i386 a.out binaries on amd64.
In particular:
- implement compat shims for old stat(2) variants and ogetdirentries(2);
- implement delivery of signals with ancient stack frame layout and
corresponding sigreturn(2);
- implement old getpagesize(2);
- provide a user-mode trampoline and LDT call gate for lcall $7,$0;
- port a.out image activator and connect it to the build as a module
on amd64.
The changes are hidden under COMPAT_43.
MFC after: 1 month
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index fe66591..649339b 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -3898,14 +3898,20 @@ struct ogetdirentries_args { }; #endif int -ogetdirentries(td, uap) - struct thread *td; - register struct ogetdirentries_args /* { - int fd; - char *buf; - u_int count; - long *basep; - } */ *uap; +ogetdirentries(struct thread *td, struct ogetdirentries_args *uap) +{ + long loff; + int error; + + error = kern_ogetdirentries(td, uap, &loff); + if (error == 0) + error = copyout(&loff, uap->basep, sizeof(long)); + return (error); +} + +int +kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, + long *ploff) { struct vnode *vp; struct file *fp; @@ -4024,9 +4030,10 @@ unionread: } VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); - error = copyout(&loff, uap->basep, sizeof(long)); fdrop(fp, td); td->td_retval[0] = uap->count - auio.uio_resid; + if (error == 0) + *ploff = loff; return (error); } #endif /* COMPAT_43 */ |