summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/accept.26
-rw-r--r--lib/libc/sys/bind.26
-rw-r--r--lib/libc/sys/connect.26
-rw-r--r--lib/libc/sys/getpeername.26
-rw-r--r--lib/libc/sys/getsockname.26
-rw-r--r--lib/libc/sys/getsockopt.28
-rw-r--r--lib/libc/sys/recv.26
-rw-r--r--sys/sys/socket.h37
8 files changed, 50 insertions, 31 deletions
diff --git a/lib/libc/sys/accept.2 b/lib/libc/sys/accept.2
index ad663c3cd99..78862142b31 100644
--- a/lib/libc/sys/accept.2
+++ b/lib/libc/sys/accept.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: accept.2,v 1.4 1998/08/17 17:35:07 deraadt Exp $
+.\" $OpenBSD: accept.2,v 1.5 1999/02/15 19:04:19 millert Exp $
.\" $NetBSD: accept.2,v 1.7 1996/01/31 20:14:42 mycroft Exp $
.\"
.\" Copyright (c) 1983, 1990, 1991, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)accept.2 8.2 (Berkeley) 12/11/93
.\"
-.Dd December 11, 1993
+.Dd February 15, 1999
.Dt ACCEPT 2
.Os BSD 4.2
.Sh NAME
@@ -44,7 +44,7 @@
.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
-.Fn accept "int s" "struct sockaddr *addr" "int *addrlen"
+.Fn accept "int s" "struct sockaddr *addr" "socklen_t *addrlen"
.Sh DESCRIPTION
The argument
.Fa s
diff --git a/lib/libc/sys/bind.2 b/lib/libc/sys/bind.2
index 247eec0c382..7d0fabb8825 100644
--- a/lib/libc/sys/bind.2
+++ b/lib/libc/sys/bind.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bind.2,v 1.3 1998/07/06 18:27:06 deraadt Exp $
+.\" $OpenBSD: bind.2,v 1.4 1999/02/15 19:04:19 millert Exp $
.\" $NetBSD: bind.2,v 1.8 1995/10/12 15:40:46 jtc Exp $
.\"
.\" Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)bind.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd June 4, 1993
+.Dd February 15, 1999
.Dt BIND 2
.Os BSD 4.2
.Sh NAME
@@ -44,7 +44,7 @@
.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
-.Fn bind "int s" "const struct sockaddr *name" "int namelen"
+.Fn bind "int s" "const struct sockaddr *name" "socklen_t namelen"
.Sh DESCRIPTION
.Fn Bind
assigns a name to an unnamed socket.
diff --git a/lib/libc/sys/connect.2 b/lib/libc/sys/connect.2
index 31ac631b87e..1a15e230b23 100644
--- a/lib/libc/sys/connect.2
+++ b/lib/libc/sys/connect.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: connect.2,v 1.9 1998/08/17 17:35:08 deraadt Exp $
+.\" $OpenBSD: connect.2,v 1.10 1999/02/15 19:04:19 millert Exp $
.\" $NetBSD: connect.2,v 1.8 1995/10/12 15:40:48 jtc Exp $
.\"
.\" Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)connect.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd June 4, 1993
+.Dd February 15, 1999
.Dt CONNECT 2
.Os BSD 4.2
.Sh NAME
@@ -44,7 +44,7 @@
.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
-.Fn connect "int s" "const struct sockaddr *name" "int namelen"
+.Fn connect "int s" "const struct sockaddr *name" "socklen_t namelen"
.Sh DESCRIPTION
The parameter
.Fa s
diff --git a/lib/libc/sys/getpeername.2 b/lib/libc/sys/getpeername.2
index 1fb0ffa6583..3d672ab5da3 100644
--- a/lib/libc/sys/getpeername.2
+++ b/lib/libc/sys/getpeername.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getpeername.2,v 1.4 1998/07/06 18:27:32 deraadt Exp $
+.\" $OpenBSD: getpeername.2,v 1.5 1999/02/15 19:04:20 millert Exp $
.\" $NetBSD: getpeername.2,v 1.6 1995/10/12 15:40:56 jtc Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)getpeername.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd June 4, 1993
+.Dd February 15, 1999
.Dt GETPEERNAME 2
.Os BSD 4.2
.Sh NAME
@@ -43,7 +43,7 @@
.Sh SYNOPSIS
.Fd #include <sys/socket.h>
.Ft int
-.Fn getpeername "int s" "struct sockaddr *name" "int *namelen"
+.Fn getpeername "int s" "struct sockaddr *name" "socklen_t *namelen"
.Sh DESCRIPTION
.Fn Getpeername
returns the name of the peer connected to
diff --git a/lib/libc/sys/getsockname.2 b/lib/libc/sys/getsockname.2
index 5bc870a1513..3e4c054e3e4 100644
--- a/lib/libc/sys/getsockname.2
+++ b/lib/libc/sys/getsockname.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getsockname.2,v 1.5 1998/07/06 18:27:37 deraadt Exp $
+.\" $OpenBSD: getsockname.2,v 1.6 1999/02/15 19:04:20 millert Exp $
.\" $NetBSD: getsockname.2,v 1.6 1995/10/12 15:41:00 jtc Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)getsockname.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd June 4, 1993
+.Dd February 15, 1999
.Dt GETSOCKNAME 2
.Os BSD 4.2
.Sh NAME
@@ -43,7 +43,7 @@
.Sh SYNOPSIS
.Fd #include <sys/socket.h>
.Ft int
-.Fn getsockname "int s" "struct sockaddr *name" "int *namelen"
+.Fn getsockname "int s" "struct sockaddr *name" "socklen_t *namelen"
.Sh DESCRIPTION
.Fn Getsockname
returns the current
diff --git a/lib/libc/sys/getsockopt.2 b/lib/libc/sys/getsockopt.2
index 1e407284707..cd3d2fb43f9 100644
--- a/lib/libc/sys/getsockopt.2
+++ b/lib/libc/sys/getsockopt.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getsockopt.2,v 1.6 1998/08/17 17:35:11 deraadt Exp $
+.\" $OpenBSD: getsockopt.2,v 1.7 1999/02/15 19:04:21 millert Exp $
.\" $NetBSD: getsockopt.2,v 1.7 1995/02/27 12:33:29 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)getsockopt.2 8.3 (Berkeley) 4/19/94
.\"
-.Dd April 19, 1994
+.Dd February 15, 1999
.Dt GETSOCKOPT 2
.Os BSD 4.3r
.Sh NAME
@@ -45,9 +45,9 @@
.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
-.Fn getsockopt "int s" "int level" "int optname" "void *optval" "int *optlen"
+.Fn getsockopt "int s" "int level" "int optname" "void *optval" "socklen_t *optlen"
.Ft int
-.Fn setsockopt "int s" "int level" "int optname" "const void *optval" "int optlen"
+.Fn setsockopt "int s" "int level" "int optname" "const void *optval" "socklen_t optlen"
.Sh DESCRIPTION
.Fn Getsockopt
and
diff --git a/lib/libc/sys/recv.2 b/lib/libc/sys/recv.2
index cc078d5180e..3f3e071e797 100644
--- a/lib/libc/sys/recv.2
+++ b/lib/libc/sys/recv.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: recv.2,v 1.11 1999/02/05 00:40:23 deraadt Exp $
+.\" $OpenBSD: recv.2,v 1.12 1999/02/15 19:04:21 millert Exp $
.\" $NetBSD: recv.2,v 1.6 1995/02/27 12:36:08 cgd Exp $
.\"
.\" Copyright (c) 1983, 1990, 1991, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)recv.2 8.3 (Berkeley) 2/21/94
.\"
-.Dd July 27, 1998
+.Dd February 15, 1999
.Dt RECV 2
.Os BSD 4.3r
.Sh NAME
@@ -48,7 +48,7 @@
.Ft ssize_t
.Fn recv "int s" "void *buf" "size_t len" "int flags"
.Ft ssize_t
-.Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr *from" "int *fromlen"
+.Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr *from" "socklen_t *fromlen"
.Ft ssize_t
.Fn recvmsg "int s" "struct msghdr *msg" "int flags"
.Sh DESCRIPTION
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 150a596d284..4924c218304 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socket.h,v 1.21 1999/02/05 00:40:22 deraadt Exp $ */
+/* $OpenBSD: socket.h,v 1.22 1999/02/15 19:04:15 millert Exp $ */
/* $NetBSD: socket.h,v 1.14 1996/02/09 18:25:36 christos Exp $ */
/*
@@ -196,6 +196,24 @@ struct sockproto {
#define SHUT_RDWR 2
/*
+ * Socket credentials.
+ */
+struct sockcred {
+ uid_t sc_uid; /* real user id */
+ uid_t sc_euid; /* effective user id */
+ gid_t sc_gid; /* real group id */
+ gid_t sc_egid; /* effective group id */
+ int sc_ngroups; /* number of supplemental groups */
+ gid_t sc_groups[1]; /* variable length */
+};
+
+/*
+ * Compute size of a sockcred structure with groups.
+ */
+#define SOCKCREDSIZE(ngrps) \
+ (sizeof(struct sockcred) + (sizeof(gid_t) * ((ngrps) - 1)))
+
+/*
* Definitions for network related sysctl, CTL_NET.
*
* Second level is protocol family.
@@ -325,6 +343,7 @@ struct cmsghdr {
/* "Socket"-level control message types: */
#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+#define SCM_CREDS 0x02 /* credientials (struct sockcred) */
/*
* 4.3 compat sockaddr, move to compat file later
@@ -351,21 +370,21 @@ struct omsghdr {
#include <sys/cdefs.h>
__BEGIN_DECLS
-int accept __P((int, struct sockaddr *, int *));
-int bind __P((int, const struct sockaddr *, int));
-int connect __P((int, const struct sockaddr *, int));
-int getpeername __P((int, struct sockaddr *, int *));
-int getsockname __P((int, struct sockaddr *, int *));
-int getsockopt __P((int, int, int, void *, int *));
+int accept __P((int, struct sockaddr *, socklen_t *));
+int bind __P((int, const struct sockaddr *, socklen_t));
+int connect __P((int, const struct sockaddr *, socklen_t));
+int getpeername __P((int, struct sockaddr *, socklen_t *));
+int getsockname __P((int, struct sockaddr *, socklen_t *));
+int getsockopt __P((int, int, int, void *, socklen_t *));
int listen __P((int, int));
ssize_t recv __P((int, void *, size_t, int));
-ssize_t recvfrom __P((int, void *, size_t, int, struct sockaddr *, int *));
+ssize_t recvfrom __P((int, void *, size_t, int, struct sockaddr *, socklen_t *));
ssize_t recvmsg __P((int, struct msghdr *, int));
ssize_t send __P((int, const void *, size_t, int));
ssize_t sendto __P((int, const void *,
size_t, int, const struct sockaddr *, int));
ssize_t sendmsg __P((int, const struct msghdr *, int));
-int setsockopt __P((int, int, int, const void *, int));
+int setsockopt __P((int, int, int, const void *, socklen_t));
int shutdown __P((int, int));
int socket __P((int, int, int));
int socketpair __P((int, int, int, int *));