Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Rebuilding from CVS on Snow Leopard



On Tue, 29 Sep 2009 21:05:13 +0900
"Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> MacOSX (and many BSD's as well?) does not define UNIX_PATH_MAX,
> and struct sockaddr_un is defined in sys/un.h as
> 
> struct  sockaddr_un {
>          unsigned char   sun_len;        /* sockaddr len including  
> null */
>          sa_family_t     sun_family;     /* [XSI] AF_UNIX */
>          char            sun_path[104];  /* [XSI] path name (gag) */
> };
> 
> so we can't define UNIX_PATH_MAX to 108.
> 
> I think it would be better to use sizeof(soun.sun_path) in place
> of UNIX_PATH_MAX. Or use sizeof(soun.sun_path)-1 so that sun_path
> is always null terminated.

Thanks, looks reasonable and I've committed it.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author