summaryrefslogtreecommitdiff
path: root/socket/sys/un.h
diff options
context:
space:
mode:
Diffstat (limited to 'socket/sys/un.h')
-rw-r--r--socket/sys/un.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/socket/sys/un.h b/socket/sys/un.h
index d88fa47069..02fc775acb 100644
--- a/socket/sys/un.h
+++ b/socket/sys/un.h
@@ -21,6 +21,8 @@
#define _SYS_UN_H 1
#include <sys/cdefs.h>
+#include <string.h> /* For prototype of `strlen'. */
+
/* Get the definition of the macro to define the common sockaddr members. */
#include <sockaddrcom.h>
@@ -33,6 +35,11 @@ struct sockaddr_un
char sun_path[108]; /* Path name. */
};
+
+/* Evaluate to actual length of the `sockaddr_un' structure. */
+#define SUN_LEN(ptr) (((struct sockaddr_un *) 0)->sun_path \
+ + strlen ((ptr)->sun_path))
+
__END_DECLS
#endif /* sys/un.h */