Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Aug 2020 12:19:42 -0400
From:      Steve Wills <swills@FreeBSD.org>
To:        freebsd-hackers@freebsd.org
Subject:   SOL_LOCAL define
Message-ID:  <50992471-7f17-dcdf-949f-1b0512a9b84d@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi,

I ran into a case where some code I was building expected SOL_LOCAL to 
be defined since LOCAL_PEERCRED was defined. See:

https://github.com/nanomsg/nng/pull/1272

for details. And looking at getpeereid.c:

https://svnweb.freebsd.org/base/head/lib/libc/gen/getpeereid.c?view=markup#l50

I see:

         error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen);

I wonder if something like a:

#define SOL_LOCAL 0

in sys/sys/un.h and a change to the above to:

         error = _getsockopt(s, SOL_LOCAL, LOCAL_PEERCRED, &xuc, &xuclen);

might be useful for compatibility and clarity? Any opinions?

Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50992471-7f17-dcdf-949f-1b0512a9b84d>