diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-06-28 23:48:16 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-06-28 23:48:16 +0000 |
commit | cf520a48762c544abd99472bdafc8727f7c831eb (patch) | |
tree | 3005d8a73bcfbc9832d49723c2d54bea52ba8fcb | |
parent | 5b86a99c1e327c037d65e14d7958b37a534ed456 (diff) |
add creat64 and mmap64.
-rw-r--r-- | sys/compat/svr4/svr4_fcntl.c | 11 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_misc.c | 36 | ||||
-rw-r--r-- | sys/compat/svr4/syscalls.master | 8 |
3 files changed, 50 insertions, 5 deletions
diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c index 0257f231fd1..0cd95f3661b 100644 --- a/sys/compat/svr4/svr4_fcntl.c +++ b/sys/compat/svr4/svr4_fcntl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_fcntl.c,v 1.15 2000/04/21 15:50:21 millert Exp $ */ +/* $OpenBSD: svr4_fcntl.c,v 1.16 2000/06/28 23:48:15 fgsch Exp $ */ /* $NetBSD: svr4_fcntl.c,v 1.14 1995/10/14 20:24:24 christos Exp $ */ /* @@ -302,6 +302,15 @@ svr4_sys_creat(p, v, retval) return sys_open(p, &cup, retval); } +int +svr4_sys_creat64(p, v, retval) + register struct proc *p; + void *v; + register_t *retval; +{ + return (svr4_sys_creat(p, v, retval)); +} + int svr4_sys_llseek(p, v, retval) register struct proc *p; diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 855db9cc971..b4ecc81c64f 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_misc.c,v 1.26 2000/06/24 21:00:30 fgsch Exp $ */ +/* $OpenBSD: svr4_misc.c,v 1.27 2000/06/28 23:48:15 fgsch Exp $ */ /* $NetBSD: svr4_misc.c,v 1.42 1996/12/06 03:22:34 christos Exp $ */ /* @@ -492,6 +492,40 @@ svr4_sys_mmap(p, v, retval) } int +svr4_sys_mmap64(p, v, retval) + register struct proc *p; + void *v; + register_t *retval; +{ + struct svr4_sys_mmap64_args *uap = v; + struct sys_mmap_args mm; + void *rp; +#define _MAP_NEW 0x80000000 + /* + * Verify the arguments. + */ + if (SCARG(uap, prot) & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) + return EINVAL; /* XXX still needed? */ + + if (SCARG(uap, len) == 0) + return EINVAL; + + SCARG(&mm, prot) = SCARG(uap, prot); + SCARG(&mm, len) = SCARG(uap, len); + SCARG(&mm, flags) = SCARG(uap, flags) & ~_MAP_NEW; + SCARG(&mm, fd) = SCARG(uap, fd); + SCARG(&mm, addr) = SCARG(uap, addr); + SCARG(&mm, pos) = SCARG(uap, pos); + + rp = (void *) round_page(p->p_vmspace->vm_daddr + MAXDSIZ); + if ((SCARG(&mm, flags) & MAP_FIXED) == 0 && + SCARG(&mm, addr) != 0 && SCARG(&mm, addr) < rp) + SCARG(&mm, addr) = rp; + + return sys_mmap(p, &mm, retval); +} + +int svr4_sys_fchroot(p, v, retval) register struct proc *p; void *v; diff --git a/sys/compat/svr4/syscalls.master b/sys/compat/svr4/syscalls.master index 2a1f6ade88d..e33d99da96c 100644 --- a/sys/compat/svr4/syscalls.master +++ b/sys/compat/svr4/syscalls.master @@ -1,4 +1,4 @@ - $OpenBSD: syscalls.master,v 1.28 2000/06/24 21:00:30 fgsch Exp $ + $OpenBSD: syscalls.master,v 1.29 2000/06/28 23:48:15 fgsch Exp $ ; $NetBSD: syscalls.master,v 1.17 1996/02/10 17:12:51 christos Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -325,7 +325,9 @@ 213 STD { int svr4_sys_getdents64(int fd, \ struct svr4_dirent64 *dp, \ int nbytes); } -214 UNIMPL mmap64 +214 STD { int svr4_sys_mmap64(svr4_caddr_t addr, \ + svr4_size_t len, int prot, int flags, int fd, \ + svr4_off64_t pos); } 215 STD { int svr4_sys_stat64(const char *path, \ struct svr4_stat64 *sb); } 216 STD { int svr4_sys_lstat64(const char *path, \ @@ -339,7 +341,7 @@ 221 UNIMPL getrlimit64 222 UNIMPL pread64 223 UNIMPL pwrite64 -224 UNIMPL creat64 +224 STD { int svr4_sys_creat64(char *path, int mode); } 225 STD { int svr4_sys_open64(char *path, int flags, \ int mode); } 226 UNIMPL rpcsys |