summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/svr4/svr4_socket.c45
-rw-r--r--sys/compat/svr4/svr4_sockmod.h11
-rw-r--r--sys/compat/svr4/svr4_syscall.h3
-rw-r--r--sys/compat/svr4/svr4_syscallargs.h9
-rw-r--r--sys/compat/svr4/svr4_syscalls.c4
-rw-r--r--sys/compat/svr4/svr4_sysent.c6
6 files changed, 65 insertions, 13 deletions
diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c
index 34d2a1d5346..3d8ca6a7d22 100644
--- a/sys/compat/svr4/svr4_socket.c
+++ b/sys/compat/svr4/svr4_socket.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: svr4_socket.c,v 1.2 1997/02/13 19:45:22 niklas Exp $ */
-/* $NetBSD: svr4_socket.c,v 1.3 1996/10/28 08:46:36 fvdl Exp $ */
+/* $OpenBSD: svr4_socket.c,v 1.3 1997/08/29 19:56:37 kstailey Exp $ */
+/* $NetBSD: svr4_socket.c,v 1.4 1997/07/21 23:02:37 christos Exp $ */
/*
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
@@ -47,13 +47,19 @@
#include <sys/queue.h>
#include <sys/mbuf.h>
#include <sys/file.h>
+#include <sys/mount.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
+#include <sys/syscallargs.h>
#include <sys/un.h>
#include <sys/stat.h>
+#include <compat/svr4/svr4_types.h>
#include <compat/svr4/svr4_util.h>
#include <compat/svr4/svr4_socket.h>
+#include <compat/svr4/svr4_signal.h>
+#include <compat/svr4/svr4_sockmod.h>
+#include <compat/svr4/svr4_syscallargs.h>
struct svr4_sockcache_entry {
struct proc *p; /* Process for the socket */
@@ -163,3 +169,38 @@ svr4_add_socket(p, path, st)
p, e->dev, e->ino));
return 0;
}
+
+
+int
+svr4_sys_socket(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct svr4_sys_socket_args *uap = v;
+
+ switch (SCARG(uap, type)) {
+ case SVR4_SOCK_DGRAM:
+ SCARG(uap, type) = SOCK_DGRAM;
+ break;
+
+ case SVR4_SOCK_STREAM:
+ SCARG(uap, type) = SOCK_STREAM;
+ break;
+
+ case SVR4_SOCK_RAW:
+ SCARG(uap, type) = SOCK_RAW;
+ break;
+
+ case SVR4_SOCK_RDM:
+ SCARG(uap, type) = SOCK_RDM;
+ break;
+
+ case SVR4_SOCK_SEQPACKET:
+ SCARG(uap, type) = SOCK_SEQPACKET;
+ break;
+ default:
+ return EINVAL;
+ }
+ return sys_socket(p, uap, retval);
+}
diff --git a/sys/compat/svr4/svr4_sockmod.h b/sys/compat/svr4/svr4_sockmod.h
index f9cb448537d..4c722dbc9ba 100644
--- a/sys/compat/svr4/svr4_sockmod.h
+++ b/sys/compat/svr4/svr4_sockmod.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: svr4_sockmod.h,v 1.3 1996/08/02 20:35:41 niklas Exp $ */
-/* $NetBSD: svr4_sockmod.h,v 1.4 1996/05/13 16:57:53 christos Exp $ */
+/* $OpenBSD: svr4_sockmod.h,v 1.4 1997/08/29 19:56:38 kstailey Exp $ */
+/* $NetBSD: svr4_sockmod.h,v 1.5 1997/07/21 23:02:38 christos Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@@ -45,9 +45,12 @@
#define SVR4_SI_GETUDATA (SVR4_SIMOD|110)
-#define SVR4_SOCK_RAW 1
+#define SVR4_SOCK_DGRAM 1
#define SVR4_SOCK_STREAM 2
-#define SVR4_SOCK_DGRAM 3
+#define SVR4_SOCK_STREAM_ORD 3
+#define SVR4_SOCK_RAW 4
+#define SVR4_SOCK_RDM 5
+#define SVR4_SOCK_SEQPACKET 6
struct svr4_si_sockparms {
int family;
diff --git a/sys/compat/svr4/svr4_syscall.h b/sys/compat/svr4/svr4_syscall.h
index 2b517ce3958..ad3811e5cbf 100644
--- a/sys/compat/svr4/svr4_syscall.h
+++ b/sys/compat/svr4/svr4_syscall.h
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from OpenBSD: syscalls.master,v 1.14 1997/08/29 19:35:20 kstailey Exp
+ * created from OpenBSD: syscalls.master,v 1.15 1997/08/29 19:55:57 kstailey Exp
*/
#define SVR4_SYS_syscall 0
@@ -126,6 +126,7 @@
#define SVR4_SYS_facl 200
#define SVR4_SYS_setreuid 202
#define SVR4_SYS_setregid 203
+#define SVR4_SYS_socket 230
#define SVR4_SYS_socketpair 231
#define SVR4_SYS_bind 232
#define SVR4_SYS_listen 233
diff --git a/sys/compat/svr4/svr4_syscallargs.h b/sys/compat/svr4/svr4_syscallargs.h
index 2935fffd73f..4bcb75e3bc7 100644
--- a/sys/compat/svr4/svr4_syscallargs.h
+++ b/sys/compat/svr4/svr4_syscallargs.h
@@ -2,7 +2,7 @@
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from OpenBSD: syscalls.master,v 1.14 1997/08/29 19:35:20 kstailey Exp
+ * created from OpenBSD: syscalls.master,v 1.15 1997/08/29 19:55:57 kstailey Exp
*/
#define syscallarg(x) union { x datum; register_t pad; }
@@ -347,6 +347,12 @@ struct svr4_sys_facl_args {
syscallarg(struct svr4_aclent *) buf;
};
+struct svr4_sys_socket_args {
+ syscallarg(int) domain;
+ syscallarg(int) type;
+ syscallarg(int) protocol;
+};
+
/*
* System call prototypes.
*/
@@ -474,6 +480,7 @@ int svr4_sys_acl __P((struct proc *, void *, register_t *));
int svr4_sys_facl __P((struct proc *, void *, register_t *));
int compat_43_sys_setreuid __P((struct proc *, void *, register_t *));
int compat_43_sys_setregid __P((struct proc *, void *, register_t *));
+int svr4_sys_socket __P((struct proc *, void *, register_t *));
int sys_socketpair __P((struct proc *, void *, register_t *));
int sys_bind __P((struct proc *, void *, register_t *));
int sys_listen __P((struct proc *, void *, register_t *));
diff --git a/sys/compat/svr4/svr4_syscalls.c b/sys/compat/svr4/svr4_syscalls.c
index 2cb880d36e7..4af1bae9804 100644
--- a/sys/compat/svr4/svr4_syscalls.c
+++ b/sys/compat/svr4/svr4_syscalls.c
@@ -2,7 +2,7 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from OpenBSD: syscalls.master,v 1.14 1997/08/29 19:35:20 kstailey Exp
+ * created from OpenBSD: syscalls.master,v 1.15 1997/08/29 19:55:57 kstailey Exp
*/
char *svr4_syscallnames[] = {
@@ -252,7 +252,7 @@ char *svr4_syscallnames[] = {
"#227 (unimplemented)", /* 227 = unimplemented */
"#228 (unimplemented)", /* 228 = unimplemented */
"#229 (unimplemented)", /* 229 = unimplemented */
- "#230 (unimplemented { int svr4_sys_socket ( int domain , int type , int protocol ) ; })", /* 230 = unimplemented { int svr4_sys_socket ( int domain , int type , int protocol ) ; } */
+ "socket", /* 230 = socket */
"socketpair", /* 231 = socketpair */
"bind", /* 232 = bind */
"listen", /* 233 = listen */
diff --git a/sys/compat/svr4/svr4_sysent.c b/sys/compat/svr4/svr4_sysent.c
index cc7060c616a..42a9ff25237 100644
--- a/sys/compat/svr4/svr4_sysent.c
+++ b/sys/compat/svr4/svr4_sysent.c
@@ -2,7 +2,7 @@
* System call switch table.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from OpenBSD: syscalls.master,v 1.14 1997/08/29 19:35:20 kstailey Exp
+ * created from OpenBSD: syscalls.master,v 1.15 1997/08/29 19:55:57 kstailey Exp
*/
#include <sys/param.h>
@@ -519,8 +519,8 @@ struct sysent svr4_sysent[] = {
sys_nosys }, /* 228 = unimplemented */
{ 0, 0,
sys_nosys }, /* 229 = unimplemented */
- { 0, 0,
- sys_nosys }, /* 230 = unimplemented { int svr4_sys_socket ( int domain , int type , int protocol ) ; } */
+ { 3, s(struct svr4_sys_socket_args),
+ svr4_sys_socket }, /* 230 = socket */
{ 4, s(struct sys_socketpair_args),
sys_socketpair }, /* 231 = socketpair */
{ 3, s(struct sys_bind_args),