summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-11-16 19:57:39 +0000
committerderaadt <deraadt@openbsd.org>1997-11-16 19:57:39 +0000
commita18852f52b906dddc68e2c2e7c0b3c1f621428bb (patch)
tree2cb67cebfff788c16668b6607af05d86fa78b3dd
parentreport correct filename in error msg; netbsd (diff)
downloadwireguard-openbsd-a18852f52b906dddc68e2c2e7c0b3c1f621428bb.tar.xz
wireguard-openbsd-a18852f52b906dddc68e2c2e7c0b3c1f621428bb.zip
add SHUT_* values as defined by XPG4.2
-rw-r--r--lib/libc/sys/shutdown.224
-rw-r--r--sys/sys/socket.h9
2 files changed, 28 insertions, 5 deletions
diff --git a/lib/libc/sys/shutdown.2 b/lib/libc/sys/shutdown.2
index 9a9b2351b3f..ad75a0735dc 100644
--- a/lib/libc/sys/shutdown.2
+++ b/lib/libc/sys/shutdown.2
@@ -52,13 +52,19 @@ the socket associated with
to be shut down.
If
.Fa how
-is 0, further receives will be disallowed.
+is
+.Ar SHUT_RD ,
+further receives will be disallowed.
If
.Fa how
-is 1, further sends will be disallowed.
+is
+.Ar SHUT_WR ,
+further sends will be disallowed.
If
.Fa how
-is 2, further sends and receives will be disallowed.
+is
+.Ar SHUT_RDWR ,
+further sends and receives will be disallowed.
.Sh DIAGNOSTICS
A 0 is returned if the call succeeds, -1 if it fails.
.Sh ERRORS
@@ -66,7 +72,11 @@ The call succeeds unless:
.Bl -tag -width Er
.It Bq Er EINVAL
.Fa how
-is not in the valid range of 0 - 2.
+is not
+.Ar SHUT_RD ,
+.Ar SHUT_WR ,
+or
+.Ar SHUT_RDWR .
.It Bq Er EBADF
.Fa S
is not a valid descriptor.
@@ -84,3 +94,9 @@ The
.Fn shutdown
function call appeared in
.Bx 4.2 .
+The
+.Fa how
+arguments used to be simply 0, 1, and 2, but now have named values
+as specified by
+.St -xpg4 .
+
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 4798c11a08b..0e038d8dc5d 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socket.h,v 1.17 1997/07/14 03:07:21 angelos Exp $ */
+/* $OpenBSD: socket.h,v 1.18 1997/11/16 19:57:39 deraadt Exp $ */
/* $NetBSD: socket.h,v 1.14 1996/02/09 18:25:36 christos Exp $ */
/*
@@ -188,6 +188,13 @@ struct sockproto {
#define PF_MAX AF_MAX
/*
+ * These are the valid values for the "how" field used by shutdown(2).
+ */
+#define SHUT_RD 0
+#define SHUT_WR 1
+#define SHUT_RDWR 2
+
+/*
* Definitions for network related sysctl, CTL_NET.
*
* Second level is protocol family.