From 75f727564c6335968600b22ffc11f9a24318bc14 Mon Sep 17 00:00:00 2001 From: Dan McDonald Date: Thu, 11 Dec 2008 18:23:00 -0500 Subject: [PATCH] 6775831 UNIX03/UNIX98: *vsx* /usr/include/sys/un.h does not ensure size_t is defined --- usr/src/uts/common/sys/un.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/usr/src/uts/common/sys/un.h b/usr/src/uts/common/sys/un.h index 1e7ce86699..207b2335b0 100644 --- a/usr/src/uts/common/sys/un.h +++ b/usr/src/uts/common/sys/un.h @@ -56,15 +56,30 @@ struct sockaddr_un { char sun_path[108]; /* path name (gag) */ }; +#if (!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || \ + defined(__EXTENSIONS__) /* * NOTE: If we ever go to BSD-style sun_len + sun_family, this macro needs to * change. * - * Also, include a strlen() prototype. + * Also, include a strlen() prototype, and we have to protect it w.r.t. + * UNIX{98,03}. And because there's strlen, we need size_t as well. */ +#if !defined(_SIZE_T) || __cplusplus >= 199711L +#define _SIZE_T +#if defined(_LP64) || defined(_I32LPx) +typedef ulong_t size_t; /* size of something in bytes */ +#else +typedef uint_t size_t; /* (historical version) */ +#endif +#endif /* _SIZE_T */ + extern size_t strlen(const char *); + #define SUN_LEN(su) (sizeof (sa_family_t) + strlen((su)->sun_path)) +#endif /* (!defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)) || ... */ + #ifdef _KERNEL int unp_discard(); #endif -- 2.11.4.GIT