Michael B Allen
2005-07-24 20:07:16 UTC
Is there a way to get the name of a unix socket like you
can using inet_ntoa with a regular socket? I thought perhaps
get{peer,sock}name might be suitable to then reference ((struct
sockaddr_un *)&addr)->sun_path but this information appears to be absent
or garbage (accept(2) returns len 2 and getsockname(2) claim the size
if the address is 18 bytes:
00000: 01 00 5d 00 8c 75 5e 00 58 fb e0 00 f0 2c e6 bf 98 26 \
|..]..u^.X....,...& |
but the offsetof sun_path is only 2).
Am I doing something wrong here?
Thanks,
Mike
can using inet_ntoa with a regular socket? I thought perhaps
get{peer,sock}name might be suitable to then reference ((struct
sockaddr_un *)&addr)->sun_path but this information appears to be absent
or garbage (accept(2) returns len 2 and getsockname(2) claim the size
if the address is 18 bytes:
00000: 01 00 5d 00 8c 75 5e 00 58 fb e0 00 f0 2c e6 bf 98 26 \
|..]..u^.X....,...& |
but the offsetof sun_path is only 2).
Am I doing something wrong here?
Thanks,
Mike