summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/compat/svr4/svr4_ipc.c29
-rw-r--r--sys/compat/svr4/svr4_socket.c14
-rw-r--r--sys/compat/svr4/svr4_sysvec.c2
-rw-r--r--sys/dev/streams/streams.c14
-rw-r--r--sys/modules/streams/Makefile4
-rw-r--r--sys/modules/svr4/Makefile1
6 files changed, 21 insertions, 43 deletions
diff --git a/sys/compat/svr4/svr4_ipc.c b/sys/compat/svr4/svr4_ipc.c
index 579c48b..3834d55 100644
--- a/sys/compat/svr4/svr4_ipc.c
+++ b/sys/compat/svr4/svr4_ipc.c
@@ -86,14 +86,10 @@ __FBSDID("$FreeBSD$");
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_ipc.h>
-#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 *,
@@ -101,9 +97,6 @@ static void svr4_to_bsd_semid_ds(const struct svr4_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 *,
@@ -112,9 +105,6 @@ 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 *,
@@ -123,9 +113,6 @@ 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)
@@ -154,9 +141,7 @@ bsd_to_svr4_ipc_perm(bpp, spp)
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;
@@ -331,10 +316,7 @@ svr4_sys_semsys(td, uap)
}
}
-MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1);
-#endif
-#ifdef SYSVMSG
static void
bsd_to_svr4_msqid_ds(bds, sds)
const struct msqid_ds *bds;
@@ -421,7 +403,7 @@ svr4_msgrcv(td, v)
return sys_msgrcv(td, &ap);
}
-
+
struct svr4_sys_msgget_args {
int what;
svr4_key_t key;
@@ -504,10 +486,6 @@ svr4_sys_msgsys(td, uap)
}
}
-MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1);
-#endif
-
-#ifdef SYSVSHM
static void
bsd_to_svr4_shmid_ds(bds, sds)
@@ -657,7 +635,7 @@ svr4_shmctl(td, v)
default:
return (EINVAL);
}
-
+
error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize);
if (error)
return (error);
@@ -697,4 +675,5 @@ svr4_sys_shmsys(td, uap)
}
MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1);
-#endif /* SYSVSHM */
+MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1);
+MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1);
diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c
index 038267c..736f618 100644
--- a/sys/compat/svr4/svr4_socket.c
+++ b/sys/compat/svr4/svr4_socket.c
@@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$");
#include <compat/svr4/svr4_signal.h>
#include <compat/svr4/svr4_sockmod.h>
#include <compat/svr4/svr4_proto.h>
+#include <compat/svr4/svr4_stropts.h>
struct svr4_sockcache_entry {
struct proc *p; /* Process for the socket */
@@ -168,6 +169,19 @@ svr4_delete_socket(p, fp)
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;
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index 8b339c8..362604b 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -313,4 +313,4 @@ static moduledata_t svr4_elf_mod = {
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);
diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c
index 3ddbcc7..7b4dcb9 100644
--- a/sys/dev/streams/streams.c
+++ b/sys/dev/streams/streams.c
@@ -176,6 +176,7 @@ static moduledata_t streams_mod = {
};
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()
@@ -329,19 +330,6 @@ svr4_ptm_alloc(td)
}
-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)
{
diff --git a/sys/modules/streams/Makefile b/sys/modules/streams/Makefile
index cbffdee..86e7996 100644
--- a/sys/modules/streams/Makefile
+++ b/sys/modules/streams/Makefile
@@ -5,10 +5,6 @@
KMOD= streams
SRCS= streams.c
-EXPORT_SYMS= svr4_str_initialized \
- svr4_stream_get \
- svr4_delete_socket
-
.if defined(DEBUG)
CFLAGS+= -DDEBUG_SVR4
.endif
diff --git a/sys/modules/svr4/Makefile b/sys/modules/svr4/Makefile
index 9fc0901..eeca8a5 100644
--- a/sys/modules/svr4/Makefile
+++ b/sys/modules/svr4/Makefile
@@ -8,6 +8,7 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h \
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
OpenPOWER on IntegriCloud