summaryrefslogtreecommitdiff
path: root/sys/compat/common
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-05 12:50:16 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-05 12:50:16 +0000
commitb2b6c7a9063c88d92da6ab79d2e1ffd7ac133576 (patch)
treede9b11224cdbee08151570d48396b881c74c831c /sys/compat/common
parentf3217e0943161ff8510a20c5604474e66e68adea (diff)
Push COMPAT_FREEBSD in front of a whale. Buggy, out of date, no
one has been weeding it, and it makes life harder. Toasts of Brennivin for its passing from many; diff ok henning@
Diffstat (limited to 'sys/compat/common')
-rw-r--r--sys/compat/common/kern_ipc_10.c235
-rw-r--r--sys/compat/common/vfs_syscalls_25.c221
2 files changed, 0 insertions, 456 deletions
diff --git a/sys/compat/common/kern_ipc_10.c b/sys/compat/common/kern_ipc_10.c
deleted file mode 100644
index 9da0154ec64..00000000000
--- a/sys/compat/common/kern_ipc_10.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/* $OpenBSD: kern_ipc_10.c,v 1.8 2004/05/05 05:18:17 mickey Exp $ */
-/* $NetBSD: kern_ipc_10.c,v 1.4 1995/10/07 06:26:25 mycroft Exp $ */
-
-/*
- * Copyright (c) 1994 Adam Glass and Charles Hannum. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Adam Glass and Charles
- * Hannum.
- * 4. The names of the authors may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/sem.h>
-#include <sys/malloc.h>
-
-#include <sys/mount.h>
-#include <sys/syscallargs.h>
-
-#include <uvm/uvm_extern.h>
-
-/*
- * Note that while we no longer have a COMPAT_10 kernel option,
- * there are other COMPAT_* options that need these old functions.
- */
-
-#if defined(SYSVSEM) && !defined(__LP64__)
-int
-compat_10_sys_semsys(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct compat_10_sys_semsys_args /* {
- syscallarg(int) which;
- syscallarg(int) a2;
- syscallarg(int) a3;
- syscallarg(int) a4;
- syscallarg(int) a5;
- } */ *uap = v;
- struct sys___semctl_args /* {
- syscallarg(int) semid;
- syscallarg(int) semnum;
- syscallarg(int) cmd;
- syscallarg(union semun *) arg;
- } */ __semctl_args;
- struct sys_semget_args /* {
- syscallarg(key_t) key;
- syscallarg(int) nsems;
- syscallarg(int) semflg;
- } */ semget_args;
- struct sys_semop_args /* {
- syscallarg(int) semid;
- syscallarg(struct sembuf *) sops;
- syscallarg(u_int) nsops;
- } */ semop_args;
-
- switch (SCARG(uap, which)) {
- case 0: /* __semctl() */
- SCARG(&__semctl_args, semid) = SCARG(uap, a2);
- SCARG(&__semctl_args, semnum) = SCARG(uap, a3);
- SCARG(&__semctl_args, cmd) = SCARG(uap, a4);
- SCARG(&__semctl_args, arg) = (union semun *)SCARG(uap, a5);
- return (sys___semctl(p, &__semctl_args, retval));
-
- case 1: /* semget() */
- SCARG(&semget_args, key) = SCARG(uap, a2);
- SCARG(&semget_args, nsems) = SCARG(uap, a3);
- SCARG(&semget_args, semflg) = SCARG(uap, a4);
- return (sys_semget(p, &semget_args, retval));
-
- case 2: /* semop() */
- SCARG(&semop_args, semid) = SCARG(uap, a2);
- SCARG(&semop_args, sops) = (struct sembuf *)SCARG(uap, a3);
- SCARG(&semop_args, nsops) = SCARG(uap, a4);
- return (sys_semop(p, &semop_args, retval));
-
- default:
- return (EINVAL);
- }
-}
-
-int
-compat_10_sys_shmsys(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct compat_10_sys_shmsys_args /* {
- syscallarg(int) which;
- syscallarg(int) a2;
- syscallarg(int) a3;
- syscallarg(int) a4;
- } */ *uap = v;
- struct sys_shmat_args /* {
- syscallarg(int) shmid;
- syscallarg(void *) shmaddr;
- syscallarg(int) shmflg;
- } */ shmat_args;
- struct sys_shmctl_args /* {
- syscallarg(int) shmid;
- syscallarg(int) cmd;
- syscallarg(struct shmid_ds *) buf;
- } */ shmctl_args;
- struct sys_shmdt_args /* {
- syscallarg(void *) shmaddr;
- } */ shmdt_args;
- struct sys_shmget_args /* {
- syscallarg(key_t) key;
- syscallarg(int) size;
- syscallarg(int) shmflg;
- } */ shmget_args;
-
- switch (SCARG(uap, which)) {
- case 0: /* shmat() */
- SCARG(&shmat_args, shmid) = SCARG(uap, a2);
- SCARG(&shmat_args, shmaddr) = (void *)SCARG(uap, a3);
- SCARG(&shmat_args, shmflg) = SCARG(uap, a4);
- return (sys_shmat(p, &shmat_args, retval));
-
- case 1: /* shmctl() */
- SCARG(&shmctl_args, shmid) = SCARG(uap, a2);
- SCARG(&shmctl_args, cmd) = SCARG(uap, a3);
- SCARG(&shmctl_args, buf) = (struct shmid_ds *)SCARG(uap, a4);
- return (sys_shmctl(p, &shmctl_args, retval));
-
- case 2: /* shmdt() */
- SCARG(&shmdt_args, shmaddr) = (void *)SCARG(uap, a2);
- return (sys_shmdt(p, &shmdt_args, retval));
-
- case 3: /* shmget() */
- SCARG(&shmget_args, key) = SCARG(uap, a2);
- SCARG(&shmget_args, size) = SCARG(uap, a3);
- SCARG(&shmget_args, shmflg) = SCARG(uap, a4);
- return (sys_shmget(p, &shmget_args, retval));
-
- default:
- return (EINVAL);
- }
-}
-
-int
-compat_10_sys_msgsys(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct compat_10_sys_msgsys_args /* {
- syscallarg(int) which;
- syscallarg(int) a2;
- syscallarg(int) a3;
- syscallarg(int) a4;
- syscallarg(int) a5;
- syscallarg(int) a6;
- } */ *uap = v;
- struct sys_msgctl_args /* {
- syscallarg(int) msqid;
- syscallarg(int) cmd;
- syscallarg(struct msqid_ds *) buf;
- } */ msgctl_args;
- struct sys_msgget_args /* {
- syscallarg(key_t) key;
- syscallarg(int) msgflg;
- } */ msgget_args;
- struct sys_msgsnd_args /* {
- syscallarg(int) msqid;
- syscallarg(void *) msgp;
- syscallarg(size_t) msgsz;
- syscallarg(int) msgflg;
- } */ msgsnd_args;
- struct sys_msgrcv_args /* {
- syscallarg(int) msqid;
- syscallarg(void *) msgp;
- syscallarg(size_t) msgsz;
- syscallarg(long) msgtyp;
- syscallarg(int) msgflg;
- } */ msgrcv_args;
-
- switch (SCARG(uap, which)) {
- case 0: /* msgctl()*/
- SCARG(&msgctl_args, msqid) = SCARG(uap, a2);
- SCARG(&msgctl_args, cmd) = SCARG(uap, a3);
- SCARG(&msgctl_args, buf) =
- (struct msqid_ds *)SCARG(uap, a4);
- return (sys_msgctl(p, &msgctl_args, retval));
-
- case 1: /* msgget() */
- SCARG(&msgget_args, key) = SCARG(uap, a2);
- SCARG(&msgget_args, msgflg) = SCARG(uap, a3);
- return (sys_msgget(p, &msgget_args, retval));
-
- case 2: /* msgsnd() */
- SCARG(&msgsnd_args, msqid) = SCARG(uap, a2);
- SCARG(&msgsnd_args, msgp) = (void *)SCARG(uap, a3);
- SCARG(&msgsnd_args, msgsz) = SCARG(uap, a4);
- SCARG(&msgsnd_args, msgflg) = SCARG(uap, a5);
- return (sys_msgsnd(p, &msgsnd_args, retval));
-
- case 3: /* msgrcv() */
- SCARG(&msgrcv_args, msqid) = SCARG(uap, a2);
- SCARG(&msgrcv_args, msgp) = (void *)SCARG(uap, a3);
- SCARG(&msgrcv_args, msgsz) = SCARG(uap, a4);
- SCARG(&msgrcv_args, msgtyp) = SCARG(uap, a5);
- SCARG(&msgrcv_args, msgflg) = SCARG(uap, a6);
- return (sys_msgrcv(p, &msgrcv_args, retval));
-
- default:
- return (EINVAL);
- }
-}
-#endif
diff --git a/sys/compat/common/vfs_syscalls_25.c b/sys/compat/common/vfs_syscalls_25.c
deleted file mode 100644
index 7ba3eeca7a4..00000000000
--- a/sys/compat/common/vfs_syscalls_25.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/* $OpenBSD: vfs_syscalls_25.c,v 1.12 2006/06/25 15:01:53 sturm Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)vfs_syscalls.c 8.28 (Berkeley) 12/10/94
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/namei.h>
-#include <sys/filedesc.h>
-#include <sys/kernel.h>
-#include <sys/file.h>
-#include <sys/vnode.h>
-#include <sys/mount.h>
-#include <sys/proc.h>
-#include <sys/uio.h>
-#include <sys/dirent.h>
-
-#include <sys/syscallargs.h>
-
-void statfs_to_ostatfs(struct proc *, struct mount *, struct statfs *, struct ostatfs *);
-
-/*
- * Convert struct statfs -> struct ostatfs
- */
-void
-statfs_to_ostatfs(p, mp, sp, osp)
- struct proc *p;
- struct mount *mp;
- struct statfs *sp;
- struct ostatfs *osp;
-{
-#ifdef COMPAT_43
- osp->f_type = mp->mnt_vfc->vfc_typenum;
-#else
- osp->f_type = 0;
-#endif
- osp->f_flags = mp->mnt_flag & 0xffff;
- osp->f_bsize = sp->f_bsize;
- osp->f_iosize = sp->f_iosize;
- osp->f_blocks = sp->f_blocks;
- osp->f_bfree = sp->f_bfree;
- osp->f_bavail = sp->f_bavail;
- osp->f_files = sp->f_files;
- osp->f_ffree = sp->f_ffree;
- /* Don't let non-root see filesystem id (for NFS security) */
- if (suser(p, 0))
- osp->f_fsid.val[0] = osp->f_fsid.val[1] = 0;
- else
- bcopy(&sp->f_fsid, &osp->f_fsid, sizeof(osp->f_fsid));
- osp->f_owner = sp->f_owner;
- osp->f_syncwrites = sp->f_syncwrites;
- osp->f_asyncwrites = sp->f_asyncwrites;
- bcopy(sp->f_fstypename, osp->f_fstypename, MFSNAMELEN);
- bcopy(sp->f_mntonname, osp->f_mntonname, MNAMELEN);
- bcopy(sp->f_mntfromname, osp->f_mntfromname, MNAMELEN);
-}
-
-/*
- * Get filesystem statistics.
- */
-/* ARGSUSED */
-int
-compat_25_sys_statfs(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct compat_25_sys_statfs_args /* {
- syscallarg(char *) path;
- syscallarg(struct ostatfs *) buf;
- } */ *uap = v;
- register struct mount *mp;
- register struct statfs *sp;
- struct ostatfs osb;
- int error;
- struct nameidata nd;
-
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
- if ((error = namei(&nd)) != 0)
- return (error);
- mp = nd.ni_vp->v_mount;
- sp = &mp->mnt_stat;
- vrele(nd.ni_vp);
- if ((error = VFS_STATFS(mp, sp, p)) != 0)
- return (error);
-
- statfs_to_ostatfs(p, mp, sp, &osb);
- return (copyout((caddr_t)&osb, (caddr_t)SCARG(uap, buf), sizeof(osb)));
-}
-
-/*
- * Get filesystem statistics.
- */
-/* ARGSUSED */
-int
-compat_25_sys_fstatfs(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- struct compat_25_sys_fstatfs_args /* {
- syscallarg(int) fd;
- syscallarg(struct ostatfs *) buf;
- } */ *uap = v;
- struct file *fp;
- struct mount *mp;
- struct statfs *sp;
- struct ostatfs osb;
- int error;
-
- if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
- return (error);
- mp = ((struct vnode *)fp->f_data)->v_mount;
- sp = &mp->mnt_stat;
- error = VFS_STATFS(mp, sp, p);
- FRELE(fp);
- if (error)
- return (error);
-
- statfs_to_ostatfs(p, mp, sp, &osb);
- return (copyout((caddr_t)&osb, (caddr_t)SCARG(uap, buf), sizeof(osb)));
-}
-
-/*
- * Get statistics on all filesystems.
- */
-int
-compat_25_sys_getfsstat(p, v, retval)
- struct proc *p;
- void *v;
- register_t *retval;
-{
- register struct compat_25_sys_getfsstat_args /* {
- syscallarg(struct ostatfs *) buf;
- syscallarg(long) bufsize;
- syscallarg(int) flags;
- } */ *uap = v;
- register struct mount *mp, *nmp;
- register struct statfs *sp;
- struct ostatfs osb;
- caddr_t sfsp;
- long count, maxcount;
- int error, flags = SCARG(uap, flags);
-
- maxcount = SCARG(uap, bufsize) / sizeof(struct ostatfs);
- sfsp = (caddr_t)SCARG(uap, buf);
- count = 0;
-
- for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist);
- mp = nmp) {
- if (vfs_busy(mp, VB_READ|VB_NOWAIT)) {
- nmp = CIRCLEQ_NEXT(mp, mnt_list);
- continue;
- }
- if (sfsp && count < maxcount) {
- sp = &mp->mnt_stat;
-
- /* Refresh stats unless MNT_NOWAIT is specified */
- if (flags != MNT_NOWAIT &&
- flags != MNT_LAZY &&
- (flags == MNT_WAIT ||
- flags == 0) &&
- (error = VFS_STATFS(mp, sp, p))) {
- nmp = CIRCLEQ_NEXT(mp, mnt_list);
- vfs_unbusy(mp);
- continue;
- }
-
- statfs_to_ostatfs(p, mp, sp, &osb);
- error = copyout((caddr_t)&osb, sfsp, sizeof(osb));
- if (error) {
- vfs_unbusy(mp);
- return (error);
- }
- sfsp += sizeof(osb);
- }
- count++;
- nmp = CIRCLEQ_NEXT(mp, mnt_list);
- vfs_unbusy(mp);
- }
-
- if (sfsp && count > maxcount)
- *retval = maxcount;
- else
- *retval = count;
-
- return (0);
-}