summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurdsocket.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/hurd/hurdsocket.h b/hurd/hurdsocket.h
index fd45f34238..611c18eb76 100644
--- a/hurd/hurdsocket.h
+++ b/hurd/hurdsocket.h
@@ -16,7 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _HURD_HURDSOCKET_H
+#define _HURD_HURDSOCKET_H
+
#include <string.h>
-#define _hurd_sun_path_dupa(__addr, __len) \
- strndupa ((__addr)->sun_path, (__len) - offsetof (struct sockaddr_un, sun_path))
+/* Returns a duplicate of ADDR->sun_path with LEN limitation. This
+ should to be used whenever reading a unix socket address, to cope with
+ sun_path possibly not including a trailing \0. */
+#define _hurd_sun_path_dupa(addr, len) \
+ strndupa ((addr)->sun_path, (len) - offsetof (struct sockaddr_un, sun_path))
+
+#endif /* hurdsocket.h */