Bug#233946: libc6-dev: <sys/un.h> does not define UNIX_PATH_MAX
On Wed, Feb 25, 2004 at 10:07:59AM +0100, Julien BLACHE wrote:
> > The define is shown in *example* code. It doesn't say anywhere that it
> > must be defined.
>
> I understand this snippet of code in the manpage as "look, this is how
> the thing is defined in the header", not as sample code.
No, that's what the *real* header is there for :)
> That's probably the problem.
Yes.
The snippet defines only example code for creating your own structure.
You should probably be doing something like:
struct sockaddr_un sizecheck;
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX sizeof(sizecheck.sun_path)
#endif
Which is nice and portable.
Infact, glibc, in the getaddrinfo case does this:
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108
#endif
Julien, can this bug be closed?
c.
Reply to: