Module Name:    src
Committed By:   riastradh
Date:           Wed Mar 26 15:17:58 UTC 2025

Modified Files:
        src/share/man/man4: unix.4

Log Message:
unix(4): Rehome paragraph about sockcred that had wandered off.

This paragraph is about LOCAL_CREDS, not about LOCAL_PEEREID.  Not
sure how it escaped but let's bring it back where it belongs!

PR kern/32844: unix domain sockets documentation is incomplete


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/share/man/man4/unix.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/unix.4
diff -u src/share/man/man4/unix.4:1.32 src/share/man/man4/unix.4:1.33
--- src/share/man/man4/unix.4:1.32	Wed Mar 26 15:14:09 2025
+++ src/share/man/man4/unix.4	Wed Mar 26 15:17:58 2025
@@ -1,4 +1,4 @@
-.\"	$NetBSD: unix.4,v 1.32 2025/03/26 15:14:09 riastradh Exp $
+.\"	$NetBSD: unix.4,v 1.33 2025/03/26 15:17:58 riastradh Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -224,6 +224,20 @@ struct sockcred {
         gid_t   sc_groups[1]; /* variable length */
 };
 .Ed
+.Pp
+The
+.Fn SOCKCREDSIZE
+macro computes the size of the
+.Vt sockcred
+structure for a specified number of groups.
+The
+.Vt cmsghdr
+fields have the following values:
+.Bd -literal -offset indent
+cmsg_len = CMSG_LEN(SOCKCREDSIZE(ngroups))
+cmsg_level = SOL_SOCKET
+cmsg_type = SCM_CREDS
+.Ed
 .It Dv LOCAL_PEEREID Pq Vt "struct unpcbid"
 May be queried with
 .Xr getsockopt 2
@@ -246,20 +260,6 @@ struct unpcbid {
 .Pp
 as defined in
 .In sys/un.h .
-.Pp
-The
-.Fn SOCKCREDSIZE
-macro computes the size of the
-.Vt sockcred
-structure for a specified number of groups.
-The
-.Vt cmsghdr
-fields have the following values:
-.Bd -literal -offset indent
-cmsg_len = CMSG_LEN(SOCKCREDSIZE(ngroups))
-cmsg_level = SOL_SOCKET
-cmsg_type = SCM_CREDS
-.Ed
 .El
 .Sh EXAMPLES
 The following code fragment shows how to bind a socket to pathname:

Reply via email to