From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: SUN_LEN
Date: Wed, 21 Aug 2013 19:00:36 +0200 [thread overview]
Message-ID: <20130821170036.GF30088@port70.net> (raw)
In-Reply-To: <20130821164220.GA20515@brightrain.aerifal.cx>
* Rich Felker <dalias@aerifal.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
next prev parent reply other threads:[~2013-08-21 17:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 9:57 SUN_LEN 小林悠
2013-08-21 12:03 ` SUN_LEN John Spencer
2013-08-21 12:23 ` SUN_LEN 小林悠
2013-08-21 12:38 ` SUN_LEN John Spencer
2013-08-21 13:27 ` SUN_LEN 小林悠
2013-08-21 14:45 ` SUN_LEN Szabolcs Nagy
2013-08-21 15:25 ` SUN_LEN 小林悠
2013-08-21 16:23 ` SUN_LEN Rich Felker
2013-08-21 16:34 ` SUN_LEN Szabolcs Nagy
2013-08-21 16:36 ` SUN_LEN Rich Felker
2013-08-21 16:42 ` SUN_LEN Rich Felker
2013-08-21 17:00 ` Szabolcs Nagy [this message]
2013-08-21 17:11 ` SUN_LEN Yu Kobayashi
2013-08-21 17:25 ` SUN_LEN Rich Felker
2013-08-21 17:29 ` SUN_LEN Yu Kobayashi
2013-08-21 17:58 ` SUN_LEN Yu Kobayashi
2013-08-21 18:07 ` SUN_LEN Rich Felker
2013-08-21 17:32 ` SUN_LEN Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130821170036.GF30088@port70.net \
--to=nsz@port70.net \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).