Commit Graph

10 Commits

Author SHA1 Message Date
Konstantin Belousov
6e0c8e1ae2 Add SOL_LOCAL symbolic constant for unix socket option level.
The constant seems to exists on MacOS X >= 10.8.

Requested by:	swills
Reviewed by:	allanjude, kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25933
2020-08-03 22:13:02 +00:00
Pedro F. Giffuni
8d48e738b5 getpeereid(3): Fix behavior on failure to match documentation.
According to the getpeereid(3) documentation, on failure the value -1 is
returned and the global variable errno is set to indicate the error. We
were returning the error instead.

Obtained from:	Apple's Libc-1244.30.3
MFC after:	5 days
2018-02-23 00:28:00 +00:00
Pedro F. Giffuni
d915a14ef0 libc: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-25 17:12:48 +00:00
Jilles Tjoelker
59797edfd8 libc: Use namespace.h in a few more files.
libc now no longer calls fstat(), socketpair() and wait(), only the
underscore-prefixed versions (_waitpid() instead of wait()).
2015-12-20 23:05:20 +00:00
Maxim Konovalov
a61f5b202b o getsockopt(2) 'level' argument should be 0, not SOCK_STREAM. It
does not hurt anything because uipc_ctloutput() does not check
sopt->sopt_level.

Pointed out by:	ru
MFC after:	1 week
2002-12-16 13:42:13 +00:00
Maxim Konovalov
04e30a1ce6 o Fix bogus getsockopt(2) call: swap SOCK_STREAM and LOCAL_PEERCRED.
The bug does not affect anything because SOCK_STREAM == LOCAL_PEERCRED == 0x1.

PR:		bin/46165
Submitted by:	Alain Thivillon <at@rominet.net>
Reviewed by:	dd
MFC after:	1 week
2002-12-15 09:37:54 +00:00
Dima Dorfman
76183f3453 Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to
reflect what it really ends up being).  Accordingly, change users of
xucred to set and check this field as appropriate.  In the kernel,
this is being done inside the new cru2x() routine which takes a
`struct ucred' and fills out a `struct xucred' according to the
former.  This also has the pleasant sideaffect of removing some
duplicate code.

Reviewed by:	rwatson
2002-02-27 04:45:37 +00:00
David E. O'Brien
60e104f3f5 Fixed slipage in editor. 2002-02-01 07:26:00 +00:00
David E. O'Brien
ea8d448a92 Fix SCM ID's. 2002-02-01 00:57:29 +00:00
Dima Dorfman
e6063dd1a6 Implement getpeereid(3), a front-end to the LOCAL_PEERCRED
socket option for the Unix domain.  It's weaker than the
socket option (this only returns the uid and gid, while the
socket opt. can return the entire group list), and is
implemented mostly for compatibility with OpenBSD.
2001-08-17 22:09:15 +00:00