Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 22 Aug 2013 02:58:28 +0900
From: Yu Kobayashi <>
Subject: Re: SUN_LEN

>> Why is it a bad thing to include <string.h>?
>> Worry about cyclic dependency?
> Well it puts a lot more stuff into the namespace and has a much larger
> parsing cost

How about this.

#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
#define SUN_LEN(s) __sun_len(s)

And add __sun_len.c like this.

#include <string.h>
#include <sys/un.h>

size_t __sun_len(struct sockaddr_un *s)
    return sizeof(sa_family_t) + strlen(s->sun_path);

I think this solve the problem.


Yu Kobayashi <>

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.