about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nis/nis_domain_of.c1
-rw-r--r--nis/yp_xdr.c1
-rwxr-xr-xscripts/check-obsolete-constructs.py1
-rw-r--r--socket/sys/un.h8
-rw-r--r--sunrpc/svc.c1
5 files changed, 8 insertions, 4 deletions
diff --git a/nis/nis_domain_of.c b/nis/nis_domain_of.c
index 06b2c54aeb..e8f714069a 100644
--- a/nis/nis_domain_of.c
+++ b/nis/nis_domain_of.c
@@ -17,6 +17,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <rpcsvc/nis.h>
+#include <string.h>
 #include <shlib-compat.h>
 
 nis_name
diff --git a/nis/yp_xdr.c b/nis/yp_xdr.c
index 3b576731da..4c9f1d22a0 100644
--- a/nis/yp_xdr.c
+++ b/nis/yp_xdr.c
@@ -31,6 +31,7 @@
 
 #include <rpcsvc/yp.h>
 #include <rpcsvc/ypclnt.h>
+#include <string.h>
 #include <shlib-compat.h>
 
 /* The NIS v2 protocol suggests 1024 bytes as a maximum length of all fields.
diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py
index 48a21cde0f..9008892daf 100755
--- a/scripts/check-obsolete-constructs.py
+++ b/scripts/check-obsolete-constructs.py
@@ -539,7 +539,6 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/types.h":                 [ "endian.h" ],
 
     "sys/uio.h":                   [ "sys/types.h" ],
-    "sys/un.h":                    [ "string.h" ],
 
     # POSIX networking headers
     # allowed: netdb.h -> netinet/in.h
diff --git a/socket/sys/un.h b/socket/sys/un.h
index 8bc9c3adb8..d174e37ea6 100644
--- a/socket/sys/un.h
+++ b/socket/sys/un.h
@@ -34,11 +34,13 @@ struct sockaddr_un
 
 
 #ifdef __USE_MISC
-# include <string.h>		/* For prototype of `strlen'.  */
+#include <bits/types/size_t.h>
+
+extern size_t strlen (const char *__s)
+     __THROW __attribute_pure__ __nonnull ((1));
 
 /* Evaluate to actual length of the `sockaddr_un' structure.  */
-# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path)	      \
-		      + strlen ((ptr)->sun_path))
+# define SUN_LEN(ptr) (__SOCKADDR_COMMON_SIZE + strlen ((ptr)->sun_path))
 #endif
 
 __END_DECLS
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index 1aa11094bf..5c0d4dcaeb 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -53,6 +53,7 @@
  */
 
 #include <errno.h>
+#include <string.h>
 #include <unistd.h>
 #include <rpc/rpc.h>
 #include <rpc/svc.h>