[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un
From: |
GOTO Masanori |
Subject: |
Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un |
Date: |
Thu, 03 Apr 2003 20:22:14 +0900 |
User-agent: |
Wanderlust/2.9.9 (Unchained Melody) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryōmae) APEL/10.3 Emacs/21.2 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI) |
At Thu, 3 Apr 2003 03:42:11 +0200,
Robert Millan wrote:
> the following code seems to be compliant with the Glibc documentation
> referred to sockaddr_un, as it provides a char* as the second component
> of the struct:
>
> #include <sys/socket.h>
> #include <sys/un.h>
> main ()
> {
> sockaddr_un test = { AF_LOCAL, "" };
> }
>
> however, when built with g++ (and not with gcc) on GNU/Hurd, it reports
> mismatch errors:
>
> test.c: In function `int main()':
> test.c:6: invalid conversion from `const char*' to `unsigned char'
d
>
> which is strange that it expects a char when both the documentation
> and <sys/un.h> agree that it should be a char*.
>
> the code in question compiles fine on GNU/Linux.
SUSv3 describes sockaddr_un has at least sun_family and sun_path. The
definition of 4.4BSD adds sun_len. Hurd uses the generic definition,
and other use the 4.4BSD's. Historically, BSD (4.2?) does not have
sun_len member in struct sockaddr_un. Nowadays BSD (after 4.3?) has
sockaddr_un.sun_len.
sockaddr_un can be variable length, so I think your program style
should be avoided. I think it's appropriate to use the substitution
like test.sun_family=AF_LOCAL, or so.
I don't think it's bug. I would like to close your report, ok?
Regards,
-- gotom
- libc0.3-dev: weirdness with sockaddr_un, Robert Millan, 2003/04/02
- Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un,
GOTO Masanori <=
- Message not available
- Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un, GOTO Masanori, 2003/04/03
- Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un, Stephan Trebels, 2003/04/03
- Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un, Robert Millan, 2003/04/03
- Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un, Jeff Bailey, 2003/04/03
- Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un, Robert Millan, 2003/04/03
- Re: Bug#187391: libc0.3-dev: weirdness with sockaddr_un, Niels Möller, 2003/04/03
Re: libc0.3-dev: weirdness with sockaddr_un, Niels Möller, 2003/04/03