summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-12-12 20:06:13 +0000
committerschwarze <schwarze@openbsd.org>2014-12-12 20:06:13 +0000
commit5ce522f7a3830380ab3236b58abf244aa0a2a6bd (patch)
treeac2904c639dc1c37cbfb3663fe1c00d93fe46c43
parentsizeof(*ptr) for some free() (diff)
downloadwireguard-openbsd-5ce522f7a3830380ab3236b58abf244aa0a2a6bd.tar.xz
wireguard-openbsd-5ce522f7a3830380ab3236b58abf244aa0a2a6bd.zip
catch up with swab.c rev. 1.9:
update SYNOPSIS and DESCRIPTION and add STANDARDS
-rw-r--r--lib/libc/string/swab.328
1 files changed, 23 insertions, 5 deletions
diff --git a/lib/libc/string/swab.3 b/lib/libc/string/swab.3
index 77e5a9ccbc7..57afdd4d792 100644
--- a/lib/libc/string/swab.3
+++ b/lib/libc/string/swab.3
@@ -25,9 +25,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: swab.3,v 1.8 2013/06/05 03:39:23 tedu Exp $
+.\" $OpenBSD: swab.3,v 1.9 2014/12/12 20:06:13 schwarze Exp $
.\"
-.Dd $Mdocdate: June 5 2013 $
+.Dd $Mdocdate: December 12 2014 $
.Dt SWAB 3
.Os
.Sh NAME
@@ -36,7 +36,11 @@
.Sh SYNOPSIS
.In unistd.h
.Ft void
-.Fn swab "const void *src" "void *dst" "size_t len"
+.Fo swab
+.Fa "const void *restrict src"
+.Fa "void *restrict dst"
+.Fa "ssize_t len"
+.Fc
.Sh DESCRIPTION
The function
.Fn swab
@@ -48,12 +52,26 @@ to the location referenced by
.Fa dst ,
swapping adjacent bytes.
.Pp
-The argument
+If
.Fa len
-must be an even number.
+is zero or less,
+.Nm
+does nothing.
+If it is odd, what happens to the last byte is unspecified.
+If
+.Fa src
+and
+.Fa dst
+overlap, behaviour is undefined.
.Sh SEE ALSO
.Xr bzero 3 ,
.Xr memset 3
+.Sh STANDARDS
+The
+.Nm
+function is compliant with the X/Open System Interfaces option of the
+.St -p1003.1-2008
+specification.
.Sh HISTORY
The
.Fn swab