Index: stable/9/sys/compat/svr4/svr4_ipc.c =================================================================== --- stable/9/sys/compat/svr4/svr4_ipc.c (revision 299213) +++ stable/9/sys/compat/svr4/svr4_ipc.c (revision 299214) @@ -1,700 +1,679 @@ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Christos Zoulas. * * 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. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ /*- * Portions of this code have been derived from software contributed * to the FreeBSD Project by Mark Newton. * * Copyright (c) 1999 Mark Newton * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. * * XXX- This code is presently a no-op on FreeBSD (and isn't compiled due * to preprocessor conditionals). A nice project for a kernel hacking * novice might be to MakeItGo, but I have more important fish to fry * at present. * * Derived from: $NetBSD: svr4_ipc.c,v 1.7 1998/10/19 22:43:00 tron Exp $ */ #include __FBSDID("$FreeBSD$"); #include "opt_sysvipc.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(const struct svr4_ipc_perm *, struct ipc_perm *); static void bsd_to_svr4_ipc_perm(const struct ipc_perm *, struct svr4_ipc_perm *); -#endif - -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(const struct semid_ds *, struct svr4_semid_ds *); static void svr4_to_bsd_semid_ds(const struct svr4_semid_ds *, struct semid_ds *); static int svr4_semop(struct thread *, void *); static int svr4_semget(struct thread *, void *); static int svr4_semctl(struct thread *, void *); -#endif - -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(const struct msqid_ds *, struct svr4_msqid_ds *); static void svr4_to_bsd_msqid_ds(const struct svr4_msqid_ds *, struct msqid_ds *); static int svr4_msgsnd(struct thread *, void *); static int svr4_msgrcv(struct thread *, void *); static int svr4_msgget(struct thread *, void *); static int svr4_msgctl(struct thread *, void *); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(const struct shmid_ds *, struct svr4_shmid_ds *); static void svr4_to_bsd_shmid_ds(const struct svr4_shmid_ds *, struct shmid_ds *); static int svr4_shmat(struct thread *, void *); static int svr4_shmdt(struct thread *, void *); static int svr4_shmget(struct thread *, void *); static int svr4_shmctl(struct thread *, void *); -#endif -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) - static void svr4_to_bsd_ipc_perm(spp, bpp) const struct svr4_ipc_perm *spp; struct ipc_perm *bpp; { bpp->key = spp->key; bpp->uid = spp->uid; bpp->gid = spp->gid; bpp->cuid = spp->cuid; bpp->cgid = spp->cgid; bpp->mode = spp->mode; bpp->seq = spp->seq; } static void bsd_to_svr4_ipc_perm(bpp, spp) const struct ipc_perm *bpp; struct svr4_ipc_perm *spp; { spp->key = bpp->key; spp->uid = bpp->uid; spp->gid = bpp->gid; spp->cuid = bpp->cuid; spp->cgid = bpp->cgid; spp->mode = bpp->mode; spp->seq = bpp->seq; } -#endif -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(bds, sds) const struct semid_ds *bds; struct svr4_semid_ds *sds; { bzero(sds, sizeof(*sds)); bsd_to_svr4_ipc_perm(&bds->sem_perm, &sds->sem_perm); sds->sem_base = (struct svr4_sem *) bds->sem_base; sds->sem_nsems = bds->sem_nsems; sds->sem_otime = bds->sem_otime; sds->sem_ctime = bds->sem_ctime; } static void svr4_to_bsd_semid_ds(sds, bds) const struct svr4_semid_ds *sds; struct semid_ds *bds; { svr4_to_bsd_ipc_perm(&sds->sem_perm, &bds->sem_perm); bds->sem_base = (struct sem *) bds->sem_base; bds->sem_nsems = sds->sem_nsems; bds->sem_otime = sds->sem_otime; bds->sem_ctime = sds->sem_ctime; } struct svr4_sys_semctl_args { int what; int semid; int semnum; int cmd; union semun arg; }; static int svr4_semctl(td, v) struct thread *td; void *v; { struct svr4_sys_semctl_args *uap = v; struct svr4_semid_ds ss; struct semid_ds bs; union semun semun; register_t rval; int cmd, error; switch (uap->cmd) { case SVR4_SEM_GETZCNT: cmd = GETZCNT; break; case SVR4_SEM_GETNCNT: cmd = GETNCNT; break; case SVR4_SEM_GETPID: cmd = GETPID; break; case SVR4_SEM_GETVAL: cmd = GETVAL; break; case SVR4_SEM_SETVAL: cmd = SETVAL; break; case SVR4_SEM_GETALL: cmd = GETVAL; break; case SVR4_SEM_SETALL: cmd = SETVAL; break; case SVR4_IPC_STAT: cmd = IPC_STAT; semun.buf = &bs; error = kern_semctl(td, uap->semid, uap->semnum, cmd, &semun, &rval); if (error) return (error); bsd_to_svr4_semid_ds(&bs, &ss); error = copyout(&ss, uap->arg.buf, sizeof(ss)); if (error == 0) td->td_retval[0] = rval; return (error); case SVR4_IPC_SET: cmd = IPC_SET; error = copyin(uap->arg.buf, (caddr_t) &ss, sizeof ss); if (error) return (error); svr4_to_bsd_semid_ds(&ss, &bs); semun.buf = &bs; return (kern_semctl(td, uap->semid, uap->semnum, cmd, &semun, td->td_retval)); case SVR4_IPC_RMID: cmd = IPC_RMID; break; default: return EINVAL; } return (kern_semctl(td, uap->semid, uap->semnum, cmd, &uap->arg, td->td_retval)); } struct svr4_sys_semget_args { int what; svr4_key_t key; int nsems; int semflg; }; static int svr4_semget(td, v) struct thread *td; void *v; { struct svr4_sys_semget_args *uap = v; struct semget_args ap; ap.key = uap->key; ap.nsems = uap->nsems; ap.semflg = uap->semflg; return sys_semget(td, &ap); } struct svr4_sys_semop_args { int what; int semid; struct svr4_sembuf * sops; u_int nsops; }; static int svr4_semop(td, v) struct thread *td; void *v; { struct svr4_sys_semop_args *uap = v; struct semop_args ap; ap.semid = uap->semid; /* These are the same */ ap.sops = (struct sembuf *) uap->sops; ap.nsops = uap->nsops; return sys_semop(td, &ap); } int svr4_sys_semsys(td, uap) struct thread *td; struct svr4_sys_semsys_args *uap; { DPRINTF(("svr4_semsys(%d)\n", uap->what)); switch (uap->what) { case SVR4_semctl: return svr4_semctl(td, uap); case SVR4_semget: return svr4_semget(td, uap); case SVR4_semop: return svr4_semop(td, uap); default: return EINVAL; } } -MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); -#endif -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(bds, sds) const struct msqid_ds *bds; struct svr4_msqid_ds *sds; { bzero(sds, sizeof(*sds)); bsd_to_svr4_ipc_perm(&bds->msg_perm, &sds->msg_perm); sds->msg_first = (struct svr4_msg *) bds->msg_first; sds->msg_last = (struct svr4_msg *) bds->msg_last; sds->msg_cbytes = bds->msg_cbytes; sds->msg_qnum = bds->msg_qnum; sds->msg_qbytes = bds->msg_qbytes; sds->msg_lspid = bds->msg_lspid; sds->msg_lrpid = bds->msg_lrpid; sds->msg_stime = bds->msg_stime; sds->msg_rtime = bds->msg_rtime; sds->msg_ctime = bds->msg_ctime; } static void svr4_to_bsd_msqid_ds(sds, bds) const struct svr4_msqid_ds *sds; struct msqid_ds *bds; { svr4_to_bsd_ipc_perm(&sds->msg_perm, &bds->msg_perm); bds->msg_first = (struct msg *) sds->msg_first; bds->msg_last = (struct msg *) sds->msg_last; bds->msg_cbytes = sds->msg_cbytes; bds->msg_qnum = sds->msg_qnum; bds->msg_qbytes = sds->msg_qbytes; bds->msg_lspid = sds->msg_lspid; bds->msg_lrpid = sds->msg_lrpid; bds->msg_stime = sds->msg_stime; bds->msg_rtime = sds->msg_rtime; bds->msg_ctime = sds->msg_ctime; } struct svr4_sys_msgsnd_args { int what; int msqid; void * msgp; size_t msgsz; int msgflg; }; static int svr4_msgsnd(td, v) struct thread *td; void *v; { struct svr4_sys_msgsnd_args *uap = v; struct msgsnd_args ap; ap.msqid = uap->msqid; ap.msgp = uap->msgp; ap.msgsz = uap->msgsz; ap.msgflg = uap->msgflg; return sys_msgsnd(td, &ap); } struct svr4_sys_msgrcv_args { int what; int msqid; void * msgp; size_t msgsz; long msgtyp; int msgflg; }; static int svr4_msgrcv(td, v) struct thread *td; void *v; { struct svr4_sys_msgrcv_args *uap = v; struct msgrcv_args ap; ap.msqid = uap->msqid; ap.msgp = uap->msgp; ap.msgsz = uap->msgsz; ap.msgtyp = uap->msgtyp; ap.msgflg = uap->msgflg; return sys_msgrcv(td, &ap); } - + struct svr4_sys_msgget_args { int what; svr4_key_t key; int msgflg; }; static int svr4_msgget(td, v) struct thread *td; void *v; { struct svr4_sys_msgget_args *uap = v; struct msgget_args ap; ap.key = uap->key; ap.msgflg = uap->msgflg; return sys_msgget(td, &ap); } struct svr4_sys_msgctl_args { int what; int msqid; int cmd; struct svr4_msqid_ds * buf; }; static int svr4_msgctl(td, v) struct thread *td; void *v; { struct svr4_sys_msgctl_args *uap = v; struct svr4_msqid_ds ss; struct msqid_ds bs; int error; switch (uap->cmd) { case SVR4_IPC_STAT: error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs); if (error) return error; bsd_to_svr4_msqid_ds(&bs, &ss); return copyout(&ss, uap->buf, sizeof ss); case SVR4_IPC_SET: error = copyin(uap->buf, &ss, sizeof ss); if (error) return error; svr4_to_bsd_msqid_ds(&ss, &bs); return (kern_msgctl(td, uap->msqid, IPC_SET, &bs)); case SVR4_IPC_RMID: return (kern_msgctl(td, uap->msqid, IPC_RMID, NULL)); default: return EINVAL; } } int svr4_sys_msgsys(td, uap) struct thread *td; struct svr4_sys_msgsys_args *uap; { DPRINTF(("svr4_msgsys(%d)\n", uap->what)); switch (uap->what) { case SVR4_msgsnd: return svr4_msgsnd(td, uap); case SVR4_msgrcv: return svr4_msgrcv(td, uap); case SVR4_msgget: return svr4_msgget(td, uap); case SVR4_msgctl: return svr4_msgctl(td, uap); default: return EINVAL; } } -MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); -#endif -#ifdef SYSVSHM - static void bsd_to_svr4_shmid_ds(bds, sds) const struct shmid_ds *bds; struct svr4_shmid_ds *sds; { bzero(sds, sizeof(*sds)); bsd_to_svr4_ipc_perm(&bds->shm_perm, &sds->shm_perm); sds->shm_segsz = bds->shm_segsz; sds->shm_lkcnt = 0; sds->shm_lpid = bds->shm_lpid; sds->shm_cpid = bds->shm_cpid; sds->shm_amp = 0; sds->shm_nattch = bds->shm_nattch; sds->shm_cnattch = 0; sds->shm_atime = bds->shm_atime; sds->shm_dtime = bds->shm_dtime; sds->shm_ctime = bds->shm_ctime; } static void svr4_to_bsd_shmid_ds(sds, bds) const struct svr4_shmid_ds *sds; struct shmid_ds *bds; { svr4_to_bsd_ipc_perm(&sds->shm_perm, &bds->shm_perm); bds->shm_segsz = sds->shm_segsz; bds->shm_lpid = sds->shm_lpid; bds->shm_cpid = sds->shm_cpid; bds->shm_nattch = sds->shm_nattch; bds->shm_atime = sds->shm_atime; bds->shm_dtime = sds->shm_dtime; bds->shm_ctime = sds->shm_ctime; } struct svr4_sys_shmat_args { int what; int shmid; void * shmaddr; int shmflg; }; static int svr4_shmat(td, v) struct thread *td; void *v; { struct svr4_sys_shmat_args *uap = v; struct shmat_args ap; ap.shmid = uap->shmid; ap.shmaddr = uap->shmaddr; ap.shmflg = uap->shmflg; return sys_shmat(td, &ap); } struct svr4_sys_shmdt_args { int what; void * shmaddr; }; static int svr4_shmdt(td, v) struct thread *td; void *v; { struct svr4_sys_shmdt_args *uap = v; struct shmdt_args ap; ap.shmaddr = uap->shmaddr; return sys_shmdt(td, &ap); } struct svr4_sys_shmget_args { int what; key_t key; int size; int shmflg; }; static int svr4_shmget(td, v) struct thread *td; void *v; { struct svr4_sys_shmget_args *uap = v; struct shmget_args ap; ap.key = uap->key; ap.size = uap->size; ap.shmflg = uap->shmflg; return sys_shmget(td, &ap); } struct svr4_sys_shmctl_args { int what; int shmid; int cmd; struct svr4_shmid_ds * buf; }; int svr4_shmctl(td, v) struct thread *td; void *v; { struct svr4_sys_shmctl_args *uap = v; struct shmid_ds bs; struct svr4_shmid_ds ss; size_t bufsize; int cmd, error; if (uap->buf != NULL) { switch (uap->cmd) { case SVR4_IPC_SET: case SVR4_SHM_LOCK: case SVR4_SHM_UNLOCK: error = copyin(uap->buf, &ss, sizeof(ss)); if (error) return (error); svr4_to_bsd_shmid_ds(&ss, &bs); break; default: return (EINVAL); } } switch (uap->cmd) { case SVR4_IPC_STAT: cmd = IPC_STAT; break; case SVR4_IPC_SET: cmd = IPC_SET; break; case SVR4_IPC_RMID: cmd = IPC_RMID; break; case SVR4_SHM_LOCK: cmd = SHM_LOCK; break; case SVR4_SHM_UNLOCK: cmd = SHM_UNLOCK; break; default: return (EINVAL); } - + error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize); if (error) return (error); switch (uap->cmd) { case SVR4_IPC_STAT: if (uap->buf != NULL) { bsd_to_svr4_shmid_ds(&bs, &ss); error = copyout(&ss, uap->buf, sizeof(ss)); } break; } return (error); } int svr4_sys_shmsys(td, uap) struct thread *td; struct svr4_sys_shmsys_args *uap; { DPRINTF(("svr4_shmsys(%d)\n", uap->what)); switch (uap->what) { case SVR4_shmat: return svr4_shmat(td, uap); case SVR4_shmdt: return svr4_shmdt(td, uap); case SVR4_shmget: return svr4_shmget(td, uap); case SVR4_shmctl: return svr4_shmctl(td, uap); default: return ENOSYS; } } MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1); -#endif /* SYSVSHM */ +MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); +MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); Index: stable/9/sys/compat/svr4/svr4_socket.c =================================================================== --- stable/9/sys/compat/svr4/svr4_socket.c (revision 299213) +++ stable/9/sys/compat/svr4/svr4_socket.c (revision 299214) @@ -1,242 +1,256 @@ /*- * Copyright (c) 1998 Mark Newton * Copyright (c) 1996 Christos Zoulas. * 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 Christos Zoulas. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ /* * In SVR4 unix domain sockets are referenced sometimes * (in putmsg(2) for example) as a [device, inode] pair instead of a pathname. * Since there is no iname() routine in the kernel, and we need access to * a mapping from inode to pathname, we keep our own table. This is a simple * linked list that contains the pathname, the [device, inode] pair, the * file corresponding to that socket and the process. When the * socket gets closed we remove the item from the list. The list gets loaded * every time a stat(2) call finds a socket. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include +#include struct svr4_sockcache_entry { struct proc *p; /* Process for the socket */ void *cookie; /* Internal cookie used for matching */ struct sockaddr_un sock;/* Pathname for the socket */ dev_t dev; /* Device where the socket lives on */ ino_t ino; /* Inode where the socket lives on */ TAILQ_ENTRY(svr4_sockcache_entry) entries; }; static TAILQ_HEAD(, svr4_sockcache_entry) svr4_head; static struct mtx svr4_sockcache_lock; static eventhandler_tag svr4_sockcache_exit_tag, svr4_sockcache_exec_tag; static void svr4_purge_sockcache(void *arg, struct proc *p); int svr4_find_socket(td, fp, dev, ino, saun) struct thread *td; struct file *fp; dev_t dev; ino_t ino; struct sockaddr_un *saun; { struct svr4_sockcache_entry *e; void *cookie = ((struct socket *)fp->f_data)->so_emuldata; DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", td, dev, ino)); mtx_lock(&svr4_sockcache_lock); TAILQ_FOREACH(e, &svr4_head, entries) if (e->p == td->td_proc && e->dev == dev && e->ino == ino) { #ifdef DIAGNOSTIC if (e->cookie != NULL && e->cookie != cookie) panic("svr4 socket cookie mismatch"); #endif e->cookie = cookie; DPRINTF(("%s\n", e->sock.sun_path)); *saun = e->sock; mtx_unlock(&svr4_sockcache_lock); return (0); } mtx_unlock(&svr4_sockcache_lock); DPRINTF(("not found\n")); return (ENOENT); } int svr4_add_socket(td, path, st) struct thread *td; const char *path; struct stat *st; { struct svr4_sockcache_entry *e; size_t len; int error; e = malloc(sizeof(*e), M_TEMP, M_WAITOK); e->cookie = NULL; e->dev = st->st_dev; e->ino = st->st_ino; e->p = td->td_proc; if ((error = copyinstr(path, e->sock.sun_path, sizeof(e->sock.sun_path), &len)) != 0) { DPRINTF(("svr4_add_socket: copyinstr failed %d\n", error)); free(e, M_TEMP); return error; } e->sock.sun_family = AF_LOCAL; e->sock.sun_len = len; mtx_lock(&svr4_sockcache_lock); TAILQ_INSERT_HEAD(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); DPRINTF(("svr4_add_socket: %s [%p,%d,%d]\n", e->sock.sun_path, td->td_proc, e->dev, e->ino)); return 0; } void svr4_delete_socket(p, fp) struct proc *p; struct file *fp; { struct svr4_sockcache_entry *e; void *cookie = ((struct socket *)fp->f_data)->so_emuldata; mtx_lock(&svr4_sockcache_lock); TAILQ_FOREACH(e, &svr4_head, entries) if (e->p == p && e->cookie == cookie) { TAILQ_REMOVE(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); DPRINTF(("svr4_delete_socket: %s [%p,%d,%d]\n", e->sock.sun_path, p, (int)e->dev, e->ino)); free(e, M_TEMP); return; } mtx_unlock(&svr4_sockcache_lock); +} + +struct svr4_strm * +svr4_stream_get(fp) + struct file *fp; +{ + struct socket *so; + + if (fp == NULL || fp->f_type != DTYPE_SOCKET) + return NULL; + + so = fp->f_data; + return so->so_emuldata; } void svr4_purge_sockcache(arg, p) void *arg; struct proc *p; { struct svr4_sockcache_entry *e, *ne; mtx_lock(&svr4_sockcache_lock); TAILQ_FOREACH_SAFE(e, &svr4_head, entries, ne) { if (e->p == p) { TAILQ_REMOVE(&svr4_head, e, entries); DPRINTF(("svr4_purge_sockcache: %s [%p,%d,%d]\n", e->sock.sun_path, p, (int)e->dev, e->ino)); free(e, M_TEMP); } } mtx_unlock(&svr4_sockcache_lock); } void svr4_sockcache_init(void) { TAILQ_INIT(&svr4_head); mtx_init(&svr4_sockcache_lock, "svr4 socket cache", NULL, MTX_DEF); svr4_sockcache_exit_tag = EVENTHANDLER_REGISTER(process_exit, svr4_purge_sockcache, NULL, EVENTHANDLER_PRI_ANY); svr4_sockcache_exec_tag = EVENTHANDLER_REGISTER(process_exec, svr4_purge_sockcache, NULL, EVENTHANDLER_PRI_ANY); } void svr4_sockcache_destroy(void) { KASSERT(TAILQ_EMPTY(&svr4_head), ("%s: sockcache entries still around", __func__)); EVENTHANDLER_DEREGISTER(process_exec, svr4_sockcache_exec_tag); EVENTHANDLER_DEREGISTER(process_exit, svr4_sockcache_exit_tag); mtx_destroy(&svr4_sockcache_lock); } int svr4_sys_socket(td, uap) struct thread *td; struct svr4_sys_socket_args *uap; { switch (uap->type) { case SVR4_SOCK_DGRAM: uap->type = SOCK_DGRAM; break; case SVR4_SOCK_STREAM: uap->type = SOCK_STREAM; break; case SVR4_SOCK_RAW: uap->type = SOCK_RAW; break; case SVR4_SOCK_RDM: uap->type = SOCK_RDM; break; case SVR4_SOCK_SEQPACKET: uap->type = SOCK_SEQPACKET; break; default: return EINVAL; } return sys_socket(td, (struct socket_args *)uap); } Index: stable/9/sys/compat/svr4/svr4_sysvec.c =================================================================== --- stable/9/sys/compat/svr4/svr4_sysvec.c (revision 299213) +++ stable/9/sys/compat/svr4/svr4_sysvec.c (revision 299214) @@ -1,314 +1,314 @@ /*- * Copyright (c) 1998 Mark Newton * 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 Christos Zoulas. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 __FBSDID("$FreeBSD$"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int bsd_to_svr4_errno[ELAST+1] = { 0, SVR4_EPERM, SVR4_ENOENT, SVR4_ESRCH, SVR4_EINTR, SVR4_EIO, SVR4_ENXIO, SVR4_E2BIG, SVR4_ENOEXEC, SVR4_EBADF, SVR4_ECHILD, SVR4_EDEADLK, SVR4_ENOMEM, SVR4_EACCES, SVR4_EFAULT, SVR4_ENOTBLK, SVR4_EBUSY, SVR4_EEXIST, SVR4_EXDEV, SVR4_ENODEV, SVR4_ENOTDIR, SVR4_EISDIR, SVR4_EINVAL, SVR4_ENFILE, SVR4_EMFILE, SVR4_ENOTTY, SVR4_ETXTBSY, SVR4_EFBIG, SVR4_ENOSPC, SVR4_ESPIPE, SVR4_EROFS, SVR4_EMLINK, SVR4_EPIPE, SVR4_EDOM, SVR4_ERANGE, SVR4_EAGAIN, SVR4_EINPROGRESS, SVR4_EALREADY, SVR4_ENOTSOCK, SVR4_EDESTADDRREQ, SVR4_EMSGSIZE, SVR4_EPROTOTYPE, SVR4_ENOPROTOOPT, SVR4_EPROTONOSUPPORT, SVR4_ESOCKTNOSUPPORT, SVR4_EOPNOTSUPP, SVR4_EPFNOSUPPORT, SVR4_EAFNOSUPPORT, SVR4_EADDRINUSE, SVR4_EADDRNOTAVAIL, SVR4_ENETDOWN, SVR4_ENETUNREACH, SVR4_ENETRESET, SVR4_ECONNABORTED, SVR4_ECONNRESET, SVR4_ENOBUFS, SVR4_EISCONN, SVR4_ENOTCONN, SVR4_ESHUTDOWN, SVR4_ETOOMANYREFS, SVR4_ETIMEDOUT, SVR4_ECONNREFUSED, SVR4_ELOOP, SVR4_ENAMETOOLONG, SVR4_EHOSTDOWN, SVR4_EHOSTUNREACH, SVR4_ENOTEMPTY, SVR4_EPROCLIM, SVR4_EUSERS, SVR4_EDQUOT, SVR4_ESTALE, SVR4_EREMOTE, SVR4_EBADRPC, SVR4_ERPCMISMATCH, SVR4_EPROGUNAVAIL, SVR4_EPROGMISMATCH, SVR4_EPROCUNAVAIL, SVR4_ENOLCK, SVR4_ENOSYS, SVR4_EFTYPE, SVR4_EAUTH, SVR4_ENEEDAUTH, SVR4_EIDRM, SVR4_ENOMSG, }; static int svr4_fixup(register_t **stack_base, struct image_params *imgp); extern struct sysent svr4_sysent[]; #undef szsigcode #undef sigcode extern int svr4_szsigcode; extern char svr4_sigcode[]; struct sysentvec svr4_sysvec = { .sv_size = SVR4_SYS_MAXSYSCALL, .sv_table = svr4_sysent, .sv_mask = 0xff, .sv_sigsize = SVR4_NSIG-1, /* NB: signal trans table indexed with signno-1 */ .sv_sigtbl = bsd_to_svr4_sig+1, .sv_errsize = ELAST, /* ELAST */ .sv_errtbl = bsd_to_svr4_errno, .sv_transtrap = NULL, .sv_fixup = svr4_fixup, .sv_sendsig = svr4_sendsig, .sv_sigcode = svr4_sigcode, .sv_szsigcode = &svr4_szsigcode, .sv_prepsyscall = NULL, .sv_name = "SVR4", .sv_coredump = elf32_coredump, .sv_imgact_try = NULL, .sv_minsigstksz = SVR4_MINSIGSTKSZ, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, .sv_psstrings = PS_STRINGS, .sv_stackprot = VM_PROT_ALL, .sv_copyout_strings = exec_copyout_strings, .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_UNDEF | SV_IA32 | SV_ILP32, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = NULL, .sv_schedtail = NULL, }; const char svr4_emul_path[] = "/compat/svr4"; Elf32_Brandinfo svr4_brand = { .brand = ELFOSABI_SYSV, .machine = EM_386, /* XXX only implemented for x86 so far. */ .compat_3_brand = "SVR4", .emul_path = svr4_emul_path, .interp_path = "/lib/libc.so.1", .sysvec = &svr4_sysvec, .interp_newpath = NULL, .brand_note = NULL, .flags = 0 }; static int svr4_fixup(register_t **stack_base, struct image_params *imgp) { Elf32_Auxargs *args; register_t *pos; KASSERT(curthread->td_proc == imgp->proc, ("unsafe svr4_fixup(), should be curproc")); args = (Elf32_Auxargs *)imgp->auxargs; pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2); if (args->execfd != -1) AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); AUXARGS_ENTRY(pos, AT_PHENT, args->phent); AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum); AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz); AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_BASE, args->base); AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid); AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP); imgp->auxargs = NULL; (*stack_base)--; **stack_base = (register_t)imgp->args->argc; return 0; } /* * Search an alternate path before passing pathname arguments on * to system calls. Useful for keeping a separate 'emulation tree'. * * If cflag is set, we check if an attempt can be made to create * the named file, i.e. we check if the directory it should * be in exists. */ int svr4_emul_find(struct thread *td, char *path, enum uio_seg pathseg, char **pbuf, int create) { return (kern_alternate_path(td, svr4_emul_path, path, pathseg, pbuf, create, AT_FDCWD)); } static int svr4_elf_modevent(module_t mod, int type, void *data) { int error; error = 0; switch(type) { case MOD_LOAD: if (elf32_insert_brand_entry(&svr4_brand) < 0) { printf("cannot insert svr4 elf brand handler\n"); error = EINVAL; break; } if (bootverbose) printf("svr4 ELF exec handler installed\n"); svr4_sockcache_init(); break; case MOD_UNLOAD: /* Only allow the emulator to be removed if it isn't in use. */ if (elf32_brand_inuse(&svr4_brand) != 0) { error = EBUSY; } else if (elf32_remove_brand_entry(&svr4_brand) < 0) { error = EINVAL; } if (error) { printf("Could not deinstall ELF interpreter entry (error %d)\n", error); break; } if (bootverbose) printf("svr4 ELF exec handler removed\n"); svr4_sockcache_destroy(); break; default: return (EOPNOTSUPP); break; } return error; } static moduledata_t svr4_elf_mod = { "svr4elf", svr4_elf_modevent, 0 }; DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_DEPEND(svr4elf, streams, 1, 1, 1); +MODULE_VERSION(svr4elf, 1); Index: stable/9/sys/dev/streams/streams.c =================================================================== --- stable/9/sys/dev/streams/streams.c (revision 299213) +++ stable/9/sys/dev/streams/streams.c (revision 299214) @@ -1,354 +1,342 @@ /*- * Copyright (c) 1998 Mark Newton * Copyright (c) 1994 Christos Zoulas * Copyright (c) 1997 Todd Vierling * 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. 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 AUTHOR ``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 AUTHOR 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. * * Stolen from NetBSD /sys/compat/svr4/svr4_net.c. Pseudo-device driver * skeleton produced from /usr/share/examples/drivers/make_pseudo_driver.sh * in 3.0-980524-SNAP then hacked a bit (but probably not enough :-). * */ #include __FBSDID("$FreeBSD$"); #include #include #include /* SYSINIT stuff */ #include /* cdevsw stuff */ #include /* malloc region definitions */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int svr4_soo_close(struct file *, struct thread *); static int svr4_ptm_alloc(struct thread *); static d_open_t streamsopen; /* * Device minor numbers */ enum { dev_ptm = 10, dev_arp = 26, dev_icmp = 27, dev_ip = 28, dev_tcp = 35, dev_udp = 36, dev_rawip = 37, dev_unix_dgram = 38, dev_unix_stream = 39, dev_unix_ord_stream = 40 }; static struct cdev *dt_ptm, *dt_arp, *dt_icmp, *dt_ip, *dt_tcp, *dt_udp, *dt_rawip, *dt_unix_dgram, *dt_unix_stream, *dt_unix_ord_stream; static struct fileops svr4_netops = { .fo_read = soo_read, .fo_write = soo_write, .fo_truncate = soo_truncate, .fo_ioctl = soo_ioctl, .fo_poll = soo_poll, .fo_kqfilter = soo_kqfilter, .fo_stat = soo_stat, .fo_close = svr4_soo_close, .fo_chmod = invfo_chmod, .fo_chown = invfo_chown, }; static struct cdevsw streams_cdevsw = { .d_version = D_VERSION, .d_open = streamsopen, .d_name = "streams", }; struct streams_softc { struct isa_device *dev; } ; #define UNIT(dev) dev2unit(dev) /* assume one minor number per unit */ typedef struct streams_softc *sc_p; static int streams_modevent(module_t mod, int type, void *unused) { switch (type) { case MOD_LOAD: dt_ptm = make_dev(&streams_cdevsw, dev_ptm, 0, 0, 0666, "ptm"); dt_arp = make_dev(&streams_cdevsw, dev_arp, 0, 0, 0666, "arp"); dt_icmp = make_dev(&streams_cdevsw, dev_icmp, 0, 0, 0666, "icmp"); dt_ip = make_dev(&streams_cdevsw, dev_ip, 0, 0, 0666, "ip"); dt_tcp = make_dev(&streams_cdevsw, dev_tcp, 0, 0, 0666, "tcp"); dt_udp = make_dev(&streams_cdevsw, dev_udp, 0, 0, 0666, "udp"); dt_rawip = make_dev(&streams_cdevsw, dev_rawip, 0, 0, 0666, "rawip"); dt_unix_dgram = make_dev(&streams_cdevsw, dev_unix_dgram, 0, 0, 0666, "ticlts"); dt_unix_stream = make_dev(&streams_cdevsw, dev_unix_stream, 0, 0, 0666, "ticots"); dt_unix_ord_stream = make_dev(&streams_cdevsw, dev_unix_ord_stream, 0, 0, 0666, "ticotsord"); if (! (dt_ptm && dt_arp && dt_icmp && dt_ip && dt_tcp && dt_udp && dt_rawip && dt_unix_dgram && dt_unix_stream && dt_unix_ord_stream)) { printf("WARNING: device config for STREAMS failed\n"); printf("Suggest unloading streams KLD\n"); } return 0; case MOD_UNLOAD: /* XXX should check to see if it's busy first */ destroy_dev(dt_ptm); destroy_dev(dt_arp); destroy_dev(dt_icmp); destroy_dev(dt_ip); destroy_dev(dt_tcp); destroy_dev(dt_udp); destroy_dev(dt_rawip); destroy_dev(dt_unix_dgram); destroy_dev(dt_unix_stream); destroy_dev(dt_unix_ord_stream); return 0; default: return EOPNOTSUPP; break; } return 0; } static moduledata_t streams_mod = { "streams", streams_modevent, 0 }; DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(streams, 1); +MODULE_DEPEND(streams, svr4elf, 1, 1, 1); /* * We only need open() and close() routines. open() calls socreate() * to allocate a "real" object behind the stream and mallocs some state * info for use by the svr4 emulator; close() deallocates the state * information and passes the underlying object to the normal socket close * routine. */ static int streamsopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct filedesc *fdp; struct svr4_strm *st; struct socket *so; struct file *fp; int family, type, protocol; int error, fd; if (td->td_dupfd >= 0) return ENODEV; switch (dev2unit(dev)) { case dev_udp: family = AF_INET; type = SOCK_DGRAM; protocol = IPPROTO_UDP; break; case dev_tcp: family = AF_INET; type = SOCK_STREAM; protocol = IPPROTO_TCP; break; case dev_ip: case dev_rawip: family = AF_INET; type = SOCK_RAW; protocol = IPPROTO_IP; break; case dev_icmp: family = AF_INET; type = SOCK_RAW; protocol = IPPROTO_ICMP; break; case dev_unix_dgram: family = AF_LOCAL; type = SOCK_DGRAM; protocol = 0; break; case dev_unix_stream: case dev_unix_ord_stream: family = AF_LOCAL; type = SOCK_STREAM; protocol = 0; break; case dev_ptm: return svr4_ptm_alloc(td); default: return EOPNOTSUPP; } fdp = td->td_proc->p_fd; if ((error = falloc(td, &fp, &fd, 0)) != 0) return error; /* An extra reference on `fp' has been held for us by falloc(). */ error = socreate(family, &so, type, protocol, td->td_ucred, td); if (error) { fdclose(fdp, fp, fd, td); fdrop(fp, td); return error; } finit(fp, FREAD | FWRITE, DTYPE_SOCKET, so, &svr4_netops); /* * Allocate a stream structure and attach it to this socket. * We don't bother locking so_emuldata for SVR4 stream sockets as * its value is constant for the lifetime of the stream once it * is initialized here. */ st = malloc(sizeof(struct svr4_strm), M_TEMP, M_WAITOK); st->s_family = so->so_proto->pr_domain->dom_family; st->s_cmd = ~0; st->s_afd = -1; st->s_eventmask = 0; so->so_emuldata = st; fdrop(fp, td); td->td_dupfd = fd; return ENXIO; } static int svr4_ptm_alloc(td) struct thread *td; { /* * XXX this is very, very ugly. But I can't find a better * way that won't duplicate a big amount of code from * sys_open(). Ho hum... * * Fortunately for us, Solaris (at least 2.5.1) makes the * /dev/ptmx open automatically just open a pty, that (after * STREAMS I_PUSHes), is just a plain pty. fstat() is used * to get the minor device number to map to a tty. * * Cycle through the names. If sys_open() returns ENOENT (or * ENXIO), short circuit the cycle and exit. * * XXX: Maybe this can now be implemented by posix_openpt()? */ static char ptyname[] = "/dev/ptyXX"; static char ttyletters[] = "pqrstuwxyzPQRST"; static char ttynumbers[] = "0123456789abcdef"; struct proc *p; register_t fd; int error, l, n; fd = -1; n = 0; l = 0; p = td->td_proc; while (fd == -1) { ptyname[8] = ttyletters[l]; ptyname[9] = ttynumbers[n]; error = kern_open(td, ptyname, UIO_SYSSPACE, O_RDWR, 0); switch (error) { case ENOENT: case ENXIO: return error; case 0: td->td_dupfd = td->td_retval[0]; return ENXIO; default: if (ttynumbers[++n] == '\0') { if (ttyletters[++l] == '\0') break; n = 0; } } } return ENOENT; } - -struct svr4_strm * -svr4_stream_get(fp) - struct file *fp; -{ - struct socket *so; - - if (fp == NULL || fp->f_type != DTYPE_SOCKET) - return NULL; - - so = fp->f_data; - return so->so_emuldata; -} static int svr4_soo_close(struct file *fp, struct thread *td) { struct socket *so = fp->f_data; /* CHECKUNIT_DIAG(ENXIO);*/ svr4_delete_socket(td->td_proc, fp); free(so->so_emuldata, M_TEMP); return soo_close(fp, td); } Index: stable/9/sys/dev =================================================================== --- stable/9/sys/dev (revision 299213) +++ stable/9/sys/dev (revision 299214) Property changes on: stable/9/sys/dev ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head/sys/dev:r298519 Index: stable/9/sys/modules/streams/Makefile =================================================================== --- stable/9/sys/modules/streams/Makefile (revision 299213) +++ stable/9/sys/modules/streams/Makefile (revision 299214) @@ -1,17 +1,13 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../dev/streams KMOD= streams SRCS= streams.c -EXPORT_SYMS= svr4_str_initialized \ - svr4_stream_get \ - svr4_delete_socket - .if defined(DEBUG) CFLAGS+= -DDEBUG_SVR4 .endif CFLAGS+= -O .include Index: stable/9/sys/modules/svr4/Makefile =================================================================== --- stable/9/sys/modules/svr4/Makefile (revision 299213) +++ stable/9/sys/modules/svr4/Makefile (revision 299214) @@ -1,34 +1,35 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/svr4 ${.CURDIR}/../../compat/svr4 KMOD= svr4 SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h \ vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c \ svr4_misc.c svr4_ioctl.c svr4_stat.c svr4_filio.c \ svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \ svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o +EXPORT_SYMS= svr4_delete_socket SRCS+= opt_ktrace.h opt_sysvipc.h CLEANFILES= svr4_assym.h svr4_genassym.o svr4_assym.h: svr4_genassym.o .if exists(@) svr4_assym.h: @/kern/genassym.sh .endif sh @/kern/genassym.sh svr4_genassym.o > ${.TARGET} svr4_locore.o: svr4_locore.s svr4_assym.h ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} svr4_genassym.o: svr4_genassym.c svr4.h @ machine ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC} .if !defined(KERNBUILDDIR) && defined(DEBUG) opt_svr4.h: echo "#define DEBUG_SVR4 1" > ${.TARGET} .endif .include Index: stable/9/sys/modules/svr4 =================================================================== --- stable/9/sys/modules/svr4 (revision 299213) +++ stable/9/sys/modules/svr4 (revision 299214) Property changes on: stable/9/sys/modules/svr4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head/sys/modules/svr4:r298519 Index: stable/9/sys/modules =================================================================== --- stable/9/sys/modules (revision 299213) +++ stable/9/sys/modules (revision 299214) Property changes on: stable/9/sys/modules ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head/sys/modules:r298519 Index: stable/9/sys =================================================================== --- stable/9/sys (revision 299213) +++ stable/9/sys (revision 299214) Property changes on: stable/9/sys ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head/sys:r298519-298520