Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 21 Aug 2013 19:00:36 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: SUN_LEN

* Rich Felker <dalias@...ifal.cx> [2013-08-21 12:42:20 -0400]:
> > Declaring strlen is not easy because size_t is not defined. So I guess
> > we also need an additional #if before including bits/alltypes.h to
> > define __NEED_size_t...
> > 
> > This is why I thought a function might be less ugly.
> 
> Here's a sketch of what it could be:
> 
> static __inline unsigned long __SUN_LEN(struct sockaddr_un *__s)
> {
> 	unsigned long __i;
> 	for (__i=0; __s->sun_path[__i]; __i++);
> 	return __i+2;
> }
> #define SUN_LEN(s) __SUN_LEN(s)

you could include stddef.h, but this works as well

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.