Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Aug 2020 20:11:28 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Steve Wills <swills@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: SOL_LOCAL define
Message-ID:  <20200803171128.GV2551@kib.kiev.ua>
In-Reply-To: <50992471-7f17-dcdf-949f-1b0512a9b84d@FreeBSD.org>
References:  <50992471-7f17-dcdf-949f-1b0512a9b84d@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 03, 2020 at 12:19:42PM -0400, Steve Wills wrote:
> 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?

This is something added by MacOS X 10.8 it seems.
I see no negative effects of the addition, so why not.
https://reviews.freebsd.org/D25933



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200803171128.GV2551>