diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-03-25 02:36:33 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-03-25 02:36:33 +0100 |
commit | c772618f22088acfe2a131e4cdedc324226de3cb (patch) | |
tree | 9dc206adf23b5220940f07e2da430e0648427108 | |
parent | 8e4d89d5aee913a0ee3aabebfa8a6eb31772ff84 (diff) | |
parent | a74a8af1543f9bf1a9dd2acd72317cafca9b5f48 (diff) |
Merge branch 't/af_local_strlen' into refs/top-bases/tschwinge/Roger_Whittaker
-rw-r--r-- | hurd/hurdsocket.h | 12 |
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 */ |