Commit graph

1924 commits

Author SHA1 Message Date
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Ed Maste b6271cc0d0 includes: avoid installing if_wg.h twice
if_wg.h was installed via dev/wg in LSUBDIRS and also explicitly.  We
want to install only wg/if_wg.h not the other headers, so add dev/wg to
the skip list in the copies and symlinks targets.

PR:		271266
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40031
2023-05-09 21:09:39 -04:00
Hans Petter Selasky bb8e8e230d Revert "libc: Implement bsort(3) a bitonic type of sorting algorithm."
Some points for the future:
 - libc is not the right place for sorting algorithms.
   Probably libutil is better suited for this purpose or
   a dedicated libsort. Should move all sorting algorithms
   away from libc eventually.
 - CheriBSD uses capabilities for memory access, and could
   benefit from a standard memswap() function.
 - Do something about qsort() in FreeBSD's libc like:
   - Mark it deprecated on FreeBSD, as a first step,
     due to missing limits on CPU time.
   - Audit the use of qsort() in the FreeBSD base system
     and consider swapping to other existing sorting
     algorithms.

Discussed with:	brooks@

Differential Revision:	https://reviews.freebsd.org/D36493

This reverts commit a7469c9c0a.
This reverts commit 7d65a450cd.
This reverts commit 8dcf3a82c5.
2023-04-20 19:16:14 +02:00
Hans Petter Selasky a7469c9c0a libc: bsort_s() requires both __BSD_VISIBLE and __EXT1_VISIBLE
Fixes build of Python:
/usr/include/stdlib.h:409:1: error: unknown type name 'errno_t'
errno_t  bsort_s(void *, rsize_t, rsize_t,

Reported by:	vishwin@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
Differential Revision:	https://reviews.freebsd.org/D36493
2023-04-19 22:12:04 +02:00
Brooks Davis 1a2249ff0b include: add a check-ldirs target
This target ensures all LDIRS, LSUBDIRS, and LSUBSUBDIRS actually exist.

Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39006
2023-04-19 16:58:06 +01:00
Hans Petter Selasky 8dcf3a82c5 libc: Implement bsort(3) a bitonic type of sorting algorithm.
The bsort(3) algorithm works by swapping objects, similarly to qsort(3),
and does not require any significant amount of additional memory.

The bsort(3) algorithm doesn't suffer from the processing time issues
known the plague the qsort(3) family of algorithms, and is bounded by
a complexity of O(log2(N) * log2(N) * N), where N is the number of
elements in the sorting array. The additional complexity compared to
mergesort(3) is a fair tradeoff in situations where no memory may
be allocated.

The bsort(3) APIs are identical to those of qsort(3), allowing for
easy drop-in and testing.

The design of the bsort(3) algorithm allows for future parallell CPU
execution when sorting arrays. The current version of the bsort(3)
algorithm is single threaded. This is possible because fixed areas
of the sorting data is compared at a time, and can easily be divided
among different CPU's to sort large arrays faster.

Reviewed by:	gbe@, delphij@, pauamma_gundo.com (manpages)
Sponsored by:	NVIDIA Networking
Differential Revision:	https://reviews.freebsd.org/D36493
2023-04-19 14:04:22 +02:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Val Packett f9c7fb7cae arpa: garbage collect ns_newmsg/ns_rdata decls
These were brought in by the libbind import, but these functions were
never actually implemented anywhere, only header declarations and symbol
map entries were imported.

Fixes: 046c3635cd ("Bring final version of libbind:")
Fixes: e45764721a ("Update our stub resolver to final version of ...")
Reported by:	ld.lld 16 being --no-undefined-version by default
Sponsored by:	https://www.patreon.com/valpackett
Reviewed by:	emaste
Pull request:	https://github.com/freebsd/freebsd-src/pull/700
Differential Revision: https://reviews.freebsd.org/D38407
2023-03-22 14:58:23 -04:00
Warner Losh a06761e3f4 secure_getenv: Put under __BSD_VISIBLE
Sponsored by:		Netflix
Reviewed by:		delphij
Differential Revision:	https://reviews.freebsd.org/D39076
2023-03-14 17:43:13 -06:00
lucy adeca21464 Add GNU glibc compatible secure_getenv
Add mostly glibc and msl compatible secure_getenv. Return NULL if
issetugid() indicates the process is tainted, otherwise getenv(x).  The
rational behind this is the fact that many Linux applications use this
function instead of getenv() as it's widely consider a, "best
practice".

Reviewed by: imp, mjg (feedback)
Pull Request: https://github.com/freebsd/freebsd-src/pull/686
Signed-off-by: Lucy Marsh <seafork@disroot.org>
2023-03-13 22:19:24 -06:00
Michael Butler 21735dfaeb include: Remove no longer existing netgraph/atm
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39005
2023-03-09 21:39:41 +00:00
Dag-Erling Smørgrav a9a38dea37 libc: Remove prototype and documentation for tzsetwall().
PR:		269445
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D38481
2023-03-07 17:20:49 +00:00
Elyes Haouas ce7db385f5 include: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-02-22 11:52:57 -05:00
John Baldwin e5dc40935f Revert "stdlib.h: Fix qsort_r compatibility with GCC 12."
This reverts commit 43703bc489.

Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D38216
2023-01-26 16:28:03 -08:00
Warner Losh 1761b09bf4 byteswap.h: Add a glibc/linux compatible byteswap.h
For endian.h to work instead of sys/endian.h, some software needs
byteswap.h available. It must define {__,}byteswap_{16,32,64}.
Included sys/_endian.h to get an appropriate __byteswap16, etc
and defines the new macros in terms of them. Enhance _endian.h
to allow it to be included from here too.

Sponsored by:		Netflix
Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D32051
2023-01-20 16:37:39 -07:00
Warner Losh 30e0d2a510 linux: For better compatibility, provide compatible endian.h
Add endian.h. This includes sys/endian.h and then adds extra defines
that glibc defines with double underscores for our
_{BIG,BYTE,LITTLE,PDP}_ENDIAN macros. We also define __FLOAT_WORD_ORDER
to be the same as _BYTE_ENDIAN since FreeBSD doesn't currently define
this, and the default with glibc is exactly this for our platforms.
Move common parts of endian.h and sys/endian.h into sys/_endian.h
to limit namespace pollution from endian.h

All this gives us good compatibility with Linux. There may be one or two
upstreams that haven't integrated the patches I tried to send up.

There are some minor differences:
	o The extra glibc macros are not defined. These are all
	  controlled with either __ at the start, or only defined
	  when glibc is being built. We also don't define macros
	  that are used internally in glibc that would pollute
	  the namespace.
	o For complete compatibility, this change must also be
	  paired with providing a glibc-compatible byteswap.h.

Sponsored by:		Netflix
Reviewed by:		mhorne, markj, jhb
Differential Revision:	https://reviews.freebsd.org/D31962
2023-01-20 16:32:45 -07:00
John Baldwin 43703bc489 stdlib.h: Fix qsort_r compatibility with GCC 12.
GCC 12 (unlike GCC 9) does not match a function argument passed to the
old qsort_r() API (as is used in the qsort_r_compat test) to a
function pointer type via __generic.  It treats the function type as a
distinct type from a function pointer.  As a workaround, add a second
definition of qsort_r for GCC 12 which uses the bare function type.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D37410
2023-01-19 14:48:52 -08:00
Kyle Evans 8b8babf044 include: put includes into -dev packages
The includes build is kind of funky, as we support either copying or
symlinking files into /usr/include.  For `copies`, we were supplying
the include/ ${TAG_ARGS}, which puts packages into `FreeBSD-runtime`,
without any consideration to the fact that we're installing headers.

Let's copy the approach that the `symlinks` target uses for now, and
add ",dev" to the TAG_ARGS so that headers at least end up in
FreeBSD-runtime-dev, which is more appropriate.  Some of these includes
are actually technically supposed to be in *other* packages and their
INCSGROUP's PACKAGE setting is actually correct, but this is less
trivial to solve.  This is a bandaid to fix the immediate problem of
some headers ending up in two different packages.

PR:		267526
Reviewed by:	dfr, manu
Differential Revision:	https://reviews.freebsd.org/D37256
2022-11-09 22:20:38 -06:00
Dag-Erling Smørgrav 817f1f3064 libc: Don't warn about RRSIG replies.
PR:		213178
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D37303
2022-11-09 17:41:47 +01:00
Mike Karels 1443613866 getaddrinfo: distinguish missing addrs from unresolvable names
Rework getaddrinfo(3) to return different error values for unresolvable
names (same as before, EAI_NONAME) and those without a requested addr
(EAI_ADDRFAMILY) when using DNS.  This is implemented via an added
error in the nsswitch layer, NS_ADDRFAMILY, which is used only by
getaddrinfo().  The error is passed through nsdispatch(3), but that
routine has no changes to handle this error.  The error originates in
the getaddrinfo DNS layer called via nsdispatch(), and is processed
by the search layer that calls nsdispatch().

While here, add a little style to returns near those that were
modified.

Reviewed in https://reviews.freebsd.org/D37139 with related changes.

Reviewed by:    bz
MFC after:      1 month
2022-11-02 11:03:31 -05:00
Mike Karels 40e4e12bd8 netdb.h: re-enable EAI_ADDRFAMILY, EAI_NODATA
EAI_ADDRFAMILY and EAI_NODATA are not in RFC 3493, but are available
and used in many other systems.  It is desirable to have at least one
of them in order to distinguish between names that do not resolve and
those that do not have the requested address type.  A change to
getaddrinfo() will use EAI_ADDRFAMILY.  Both were "#if 0"; re-enable,
conditioned on __BSD_VISIBLE, and update comments.  Also add comments
and __BSD_VISIBLE conditional for the last three EAI errors, which
are not in the RFC or POSIX.  Note, all of these are available in
NetBSD and OpenBSD, and EAI_ADDRFAMILY and EAI_NODATA are available
in Linux (glibc).

Reviewed in https://reviews.freebsd.org/D37139 with related changes.

Reviewed by:	bz
MFC after:	1 month
2022-11-02 11:03:30 -05:00
John Baldwin 744bfb2131 Import the WireGuard driver from zx2c4.com.
This commit brings back the driver from FreeBSD commit
f187d6dfbf plus subsequent fixes from
upstream.

Relative to upstream this commit includes a few other small fixes such
as additional INET and INET6 #ifdef's, #include cleanups, and updates
for recent API changes in main.

Reviewed by:	pauamma, gbe, kevans, emaste
Obtained from:	git@git.zx2c4.com:wireguard-freebsd @ 3cc22b2
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36909
2022-10-28 13:36:12 -07:00
Alexander V. Chernikov 11ca01e9aa netlink: add headers installation 2022-10-01 16:31:58 +00:00
Ed Schouten af3c78886f Alter the prototype of qsort_r(3) to match POSIX, which adopted the
glibc-based interface.

Unfortunately, the glibc maintainers, despite knowing the existence
of the FreeBSD qsort_r(3) interface in 2004 and refused to add the
same interface to glibc based on grounds of the lack of standardization
and portability concerns, has decided it was a good idea to introduce
their own qsort_r(3) interface in 2007 as a GNU extension with a
slightly different and incompatible interface.

With the adoption of their interface as POSIX standard, let's switch
to the same prototype, there is no need to remain incompatible.

C++ and C applications written for the historical FreeBSD interface
get source level compatibility when building in C++ mode, or when
building with a C compiler with C11 generics support, provided that
the caller passes a fifth parameter of qsort_r() that exactly matches
the historical FreeBSD comparator function pointer type and does not
redefine the historical qsort_r(3) prototype in their source code.

Symbol versioning is used to keep old binaries working.

MFC:			never
Relnotes:		yes
Reviewed by:		cem, imp, hps, pauamma
Differential revision:	https://reviews.freebsd.org/D17083
2022-09-30 15:26:30 -07:00
Hajimu UMEMOTO 10d872339a corrected RFC numbers in comments to proper ones 2022-09-29 19:57:59 +09:00
John Baldwin a2e41a585b libc rpc: Fix mismatches in prototypes for array bounds.
Various RPC functions used a bare pointer in function prototypes to
describe fixed-length buffer arguments but used a fixed-length array
in the function definition.  The manual page for these functions
describes the parameters as being fixed-length buffers, so update
the prototypes to match the definitions.

Reviewed by:	imp, emaste
Reported by:	GCC -Warray-parameter
Differential Revision:	https://reviews.freebsd.org/D36757
2022-09-28 14:01:36 -07:00
Aymeric Wibo 05c9a0158f libc: Add strverscmp(3) and versionsort(3)
Add a strverscmp(3) function to libc, a GNU extension I implemented by
reading its glibc manual page. It orders strings following a much more
natural ordering (e.g. "ent1 < ent2 < ent10" as opposed to
"ent1 < ent10 < ent2" with strcmp(3)'s lexicographic ordering).

Also add versionsort(3) for use as scandir(3)'s compar argument.

Update manual page for scandir(3) and add one for strverscmp(3).

Reviewed by:	pstef, gbe, kib
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D35807
2022-08-25 03:29:03 +03:00
Konstantin Belousov 9fb8e8eede libc: add scandirat(3)
Reviewed by:	emaste, imp, kevans, markj, Aymeric Wibo <obiwac@gmail.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D36301
2022-08-24 22:26:00 +03:00
Brooks Davis 1a2ff852e3 include/i386: fix release builds
Add a target to ensure the presence of /usr/include/i386
before we try to install files.  In the buildworld/installworld path
it gets created different ways, but for distribute (used in releases)
we need it in the subdir.

(Creating of this the x86, pc, powerpc directories is far too complex.
We should look for ways to simplify it.)

Reported by:	lwhsu
Fixes:		a09ea2bbc3
2022-06-13 21:37:34 +01:00
Dmitry Ovsyannikov 9f48eea366 rpcbind: get contact addr from xprt members
Addition to D31491 in order to actually resolve the top root cause.

Currently rpcbind gets contact address from connectionless xprt->xp_p2
member of a transport and will fail to get it when working over
connection oriented transport, leading to a guess game in terms of
contact address on rpcinfo requests like RPCBPROC_GETVERSADDR or
RPCBPROC_GETADDRLIST and poor returns which may influence a user
of a call and specifically reported on OSX clients, which tend to
not provide address hint from rpcinfo request to a server.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D35220
2022-06-13 08:54:08 -05:00
Brooks Davis 5ea3094e6a amd64: -m32 support for machine/md_var.h
Install the i386 md_var.h under /usr/include/i386 on amd64 and include
when targeting i386.

This is a mostly kernel-only header required by procstat's ZFS support.
It is pulled in by the i386 machine/counter.h.

Reviewed by:	jhb, imp
2022-06-13 18:35:40 +01:00
Brooks Davis 8dc3fdfe69 amd64: -m32 support for machine/counter.h
Install the i386 counter.h under /usr/include/i386 on amd64 and include
when targeting i386.

This is a kernel-only header required by procstat's ZFS support.

Reviewed by:	jhb, imp
2022-06-13 18:35:40 +01:00
Brooks Davis 9f7588dd93 amd64: -m32 support for machine/pcpu_aux.h
Install the i386 pcpu_aux.h under /usr/include/i386 on amd64 and include
when targeting i386.

This is a kernel-only header that is required by procstat's ZFS support.

Reviewed by:	jhb, imp
2022-06-13 18:35:40 +01:00
Brooks Davis f6fada5eed amd64: -m32 support for machine/pcpu.h
Install the i386 pcpu.h under /usr/include/i386 on amd64 and include
when targeting i386.

This is a kernel-only header and should not be required, but
procstat's zfs support includes this with _KERNEL defined.

Reviewed by:	jhb, imp
2022-06-13 18:35:40 +01:00
Brooks Davis a69511db18 amd64: -m32 support for machine/vmparam.h
Install the i386 vmparam.h under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:39 +01:00
Brooks Davis b3120c0aeb amd64: -m32 support for machine/proc.h
Install the i386 proc.h under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:39 +01:00
Brooks Davis 3cd1b382c6 amd64: -m32 support for machine/pmap.h
Install the i386 pmap.h under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:39 +01:00
Brooks Davis c2c8157ebe amd64: -m32 support for machine/segments.h
Install the i386 segments.h under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:39 +01:00
Brooks Davis 08f16287a5 amd64: -m32 support for machine/atomic.h
Install the i386 atomic.h under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:39 +01:00
Brooks Davis 92a98611ca amd64: -m32 support for machine/asm(macros).h
Install the i386 versions under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:39 +01:00
Brooks Davis 68049f6da8 amd64: -m32 support for machine/profile.h
Install the i386 profile.h under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:39 +01:00
Brooks Davis cca1927261 amd64: -m32 support for machine/cpufunc.h
Install the i386 cpufunc.h under /usr/include/i386 on amd64 and include
when targeting i386.

Reviewed by:	jhb, imp
2022-06-13 18:35:38 +01:00
Brooks Davis a09ea2bbc3 amd64: add an i386 include directory
This directory will hold i386-specific headers that are needed for
-m32 support on amd64 and where the amd64 and i386 cases have too
little in common for combining them to make sense.  Files to be
installed will come in later commits.

With the currently required set of files, this could be done with
another INCGROUP in include/Makefile, but at least one file that
might want -m32 support (ieeefp.h) conflicts with a files installed
in /usr/include.

Reviewed by:	jhb, imp
2022-06-13 18:35:38 +01:00
Kirk McKusick c7996ddf80 Create a new GEOM utility, gunion(8).
The gunion(8) utility is used to track changes to a read-only disk on
a writable disk. Logically, a writable disk is placed over a read-only
disk. Write requests are intercepted and stored on the writable
disk. Read requests are first checked to see if they have been
written on the top (writable disk) and if found are returned. If
they have not been written on the top disk, then they are read from
the lower disk.

The gunion(8) utility can be especially useful if you have a large
disk with a corrupted filesystem that you are unsure of how to
repair. You can use gunion(8) to place another disk over the corrupted
disk and then attempt to repair the filesystem. If the repair fails,
you can revert all the changes in the upper disk and be back to the
unchanged state of the lower disk thus allowing you to try another
approach to repairing it. If the repair is successful you can commit
all the writes recorded on the top disk to the lower disk.

Another use of the gunion(8) utility is to try out upgrades to your
system. Place the upper disk over the disk holding your filesystem
that is to be upgraded and then run the upgrade on it. If it works,
commit it; if it fails, revert the upgrade.

Further details can be found in the gunion(8) manual page.

Reviewed by: Chuck Silvers, kib (earlier version)
tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D32697
2022-02-28 16:36:08 -08:00
John Baldwin c00d345665 Install unwind.h into /usr/include
Install headers from LLVM's libunwind in place of the headers from
libcxxrt and allow C applications to use the library.

As part of this, remove include/unwind.h and switch libthr over to
using the installed unwind.h.

Reviewed by:	dim, emaste
MFC after:	10 days
Differential Revision: https://reviews.freebsd.org/D34065
2022-02-10 19:00:32 +01:00
John Baldwin 522f538354 Change the return value of _Unwind_GetCFA in include/unwind.h.
I tested the original commit as part of a series that culminates in
removing this header and installing LLVM libunwind's unwind.h in its
place so missed updating this header as was done in b84693501a.

Pointy hat to:	jhb
Reported by:	kevans
Fixes:		3a502289d3 Use uintptr_t for return type of _Unwind_GetCFA.
2022-01-27 14:42:40 -08:00
John Baldwin b84693501a Use an unsigned 64-bit integer for exception class.
This matches the type in other unwind headers (LLVM libunwind,
libcxxrt, glibc).

NB: include/unwind.h is not installed but is only used by libthr

Reviewed by:	imp, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D34049
2022-01-27 10:34:35 -08:00
Cy Schubert 3b9b51fe46 ipfilter: Move kernel bits to netpfil
Through fixes and improvements our ipfilter sources have diverged
enough to warrant move from contrib into sys/netpil. Now that I'm
planning on implementing MSS clamping as in iptables it makes more
sense to move ipfilter to netpfil.

This is the first of three commits the ipfilter move.

Suggested by glebius on two occaions.

Suggested by and discussed with:	glebius
Reviewed by:				glebius, kp (for #network)
MFC after:				1 month
Differential Revision:		https://reviews.freebsd.org/D33510
2021-12-20 06:16:33 -08:00
David CARLIER 65dd321054 sched.h: Use pid_t type for pid argument
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33533
2021-12-17 08:22:21 +02:00
Ed Maste 301d1de6ba Remove 'All Rights Reserved' from xlocale FreeBSD Foundation copyrights
Sponsored by:	The FreeBSD Foundation
2021-12-16 14:29:12 -05:00
Konstantin Belousov 5346570276 swapoff: add one more variant of the syscall
Requested and reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33343
2021-12-09 02:48:46 +02:00
Stefan Eßer 5e04571cf3 sys/bitset.h: reduce visibility of BIT_* macros
Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by:	kib, markj
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33235
2021-12-05 23:00:25 +01:00
Konstantin Belousov a18ddf7757 posix_spawn: add closefrom non-portable action
Namely posix_spawn_file_actions_addclosefrom_np, in the form it is
provided by glibc.

Reviewed by:	kevans, ngie (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33143
2021-11-30 03:43:54 +02:00
Konstantin Belousov 25cda42a49 posix_spawn: add chdir-related non-portable actions
Namely posix_spawn_file_actions_addchdir_np and
posix_spawn_file_actions_addfchdir_np.

Reviewed by:	kevans, ngie (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33143
2021-11-30 03:43:54 +02:00
Konstantin Belousov 90fa9705d5 sched.h: Hide all Linux compat sched_* functions under _WITH_CPU_SET_T
Instead of only hiding cpu_set_t compat typedef itself.

Too many software packages assume that sched_getaffinity() presence
implies full source compatibility with glibc.  We can (and should)
handle missing CPU_* macros, but then there are incompatible BIT_* uses
which cannot be fixed in src/.

So hide everything under _WITH_CPU_SET_T, in particular, do not expose
sched_getcpu(), sched_get/setaffinity(), as well as CPU_* and BIT_*
macros.  Consumers that want sched* functions must opt-in.

Reported by:	portmgr (antoine)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-13 19:27:54 +02:00
Konstantin Belousov 77b2c2f814 Add sched_getcpu()
for compatibility with Linux.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32901
2021-11-10 21:18:54 +02:00
Konstantin Belousov 43736b71dd Add sched_get/setaffinity(3)
for compatibility with Linux.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32901
2021-11-10 21:18:54 +02:00
Konstantin Belousov 160b4b922b Add real sched.h
It is required by IEEE Std 1003.1-2008 AKA POSIX.

Put some Linux compatibility stuff under BSD_VISIBLE namespace, in
particular, sys/cpuset.h definitions.  Also, if user really want
Linux compatibility, she can request cpu_set_t typedef with
_WITH_CPU_SET_T define.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32901
2021-11-10 21:18:53 +02:00
Mariusz Zaborski 597b026757 libc: add clearenv function
The clearenv(3) function allows us to clear all environment
variable in one shot. This may be useful for security programs that
want to control the environment or what variables are passed to new
spawned programs.

Reviewed by:	scf, markj (secteam), 0mp (manpages)
Differential Revision:	https://reviews.freebsd.org/D28223
2021-11-07 16:20:15 +01:00
Steve Kargl 046e2d5db1 Implementations of cexpl()
The change implements cexpl() for both ld80 and ld128 architectures.
Testing was done on x86_64 and aarch64 systems.

Along the way sincos[fl]() use an optimization that reduces the argument
to being done one rather than twice.  This optimization actually pointed
to a bug in the ld128 version of sincosl(), which is now fixed.  In
addition, the minmax polynomial coefficients for sincosl() have been
updated.

A concise log of the file-by-file changes follows.

* include/complex.h:
  . Add a prototype for cexpl().

* lib/msun/Makefile:
  . Add s_cexpl.c to the build.
  . Setup a link for cexpl.3 to cexp.3.

* lib/msun/Symbol.map:
  . Expose cexpl symbol in libm shared library.

* lib/msun/ld128/s_cexpl.c:
  * Implementation of cexpl() for 128-bit long double architectures.
    Tested on an aarch64 system.

* lib/msun/ld80/s_cexpl.c:
  * Implementation of cexpl() for Intel 80-bit long double.

* lib/msun/man/cexp.3:
  . Document cexpl().

* lib/msun/man/complex.3:
  . Add a BUGS section about cpow[fl].

* lib/msun/src/s_cexp.c:
  . Include float.h for weak references on 53-bit long double targets.
  . Use sincos() to reduce argument reduction cost.

* lib/msun/src/s_cexpf.c:
  . Use sincosf() to reduce argument reduction cost.

* lib/msun/src/k_sincosl.h:
  . Catch up with the new minmax polynomial coefficients for the kernel for
    the 128-bit cosl() implementation.
  . BUG FIX: *cs was used where *sn should have been.  This means that sinl()
    was no computed correctly when iy != 0.

* lib/msun/src/s_cosl.c:
  . Include fpmath.h to get access to IEEEl2bits.
  . Replace M_PI_4 with pio4,  a 64-bit or 113-bit approximation for pi / 4.

PR:	216862
MFC after:	1 week
2021-11-05 13:51:42 +02:00
Konstantin Belousov 49ad342cc1 Add _Fork()
Current POSIX standard requires fork() to be async-signal safe.  Neither
our implementation, nor implementations in other operating systems are,
and practically it is impossible to make fork() async-signal safe without
too much efforts.  Also, that would put undue requirement that all atfork
handlers should be async-signal safe as well, which contradicts its main
use.

As result, Austin Group dropped the requirement, and added a new function
_Fork() that should be async-signal safe, but it does not call atfork
handlers.  Basically, _Fork() can be implemented as a raw syscall.

Release of glibc 2.34 added _Fork(), do the same for FreeBSD.
Clarify threading behavior for fork() in the manpage.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D31378
2021-08-03 21:19:32 +03:00
Warner Losh 7b797ba27a time.h: reduce CLOCK_ namespace pollution, move to _clock_id.h
Attempt to comply with the strict namespace pollution requirements of
_POSIX_C_SOURCE. Add guards to limit visitbility of CLOCK_ and TIMER_
defines as appropriate. Only define the CLOCK_ variables relevant to the
specific standards. Move all the sharing to sys/_clock_id.h and make
time.h and sys/time.h both include that rather than copy due to the
now large number of clocks and compat defines.

Please note: The old time.h previously used these newer dates:
	CLOCK_REALTIME			199506
	CLOCK_MONOTONIC			200112
	CLOCK_THREAD_CPUTIME_ID		200112
	CLOCK_PROCESS_CPUTIME_ID	200112

but glibc defines all of these for 199309. glibc uses this date for all
these values, however, only CLOCK_REALTIME was in IEEE 1003.1b. Add a
comment about this to document it. A large number of programs and
libraries assume that these will be defined for _POSIX_C_SOURCE =
199309.

In addition, leak CLOCK_UPTIME_FAST for the pocl package until it can be
updated to use a simple CLOCK_MONOTONIC.

Reviewed by:		kib
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31056
2021-07-30 17:20:22 -06:00
Konstantin Belousov ee37f64cf8 libc: add mempcpy(3) and wmempcpy(3)
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31180
2021-07-15 19:40:28 +03:00
Alfonso Gregory 849dcdb1c0 Change strmode argument type to mode_t
Finally, we have the correct function definition for strmode.  NetBSD/OpenBSD
did this many years ago. This code is weird sign extension safe.

Reviewed by:	imp@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/493
2021-06-29 17:38:45 -06:00
Alex Richardson 9bb8a4091c Reduce code duplication in machine/_types.h
Many of these typedefs are the same across all architectures or can
be set based on an architecture-independent compiler-provided macro
(e.g. __SIZEOF_SIZE_T__). These macros have been available since GCC 4.6
and Clang sometime before 3.0 (godbolt.org does not have any older clang
versions installed).

I originally considered using the compiler-provided `__FOO_TYPE__` directly.
However, in order to do so we have to check that those match the previous
typedef exactly (not just that they have the same size) since any change
would be an ABI break. For example, changing `long` to `long long` results
in different C++ name mangling. Additionally, Clang and GCC disagree on
the underlying type for some of (u)int*_fast_t types, so this change
only moves the definitions that are identical across all architectures
and does not touch those types.

This de-deduplication will allow us to have a smaller diff downstream in
CheriBSD: we only have to only change the (u)intptr_t definition in
sys/_types.h in CheriBSD instead of having to change machine/_types.h for
all CHERI-enabled architectures (currently RISC-V, AArch64 and MIPS).

Reviewed By: imp, kib
Differential Revision: https://reviews.freebsd.org/D29895
2021-06-14 16:30:16 +01:00
Emmanuel Vadot 663b174b5b an: Remove driver
Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision:	https://reviews.freebsd.org/D30679
Reviewed by:		imp (earlier version), emaste (earlier version)
Sponsored by:		Diablotin Systems
2021-06-11 21:18:04 +02:00
Emmanuel Vadot f41efc453a Fix build with WITHOUT_AUDIT=yes in src.conf
Always install the audit related includes are some part of the source
always requires them.

Reported by:	many
Fixes:	8c3eaf244a
2021-04-15 14:11:13 +02:00
John Baldwin 7af04dff02 Only symlink cryptodev.h into /usr/include/crypto/
I missed updating the symlink side in the earlier commit.

Fixes:		283352dd4f
MFC after:	1 week
2021-03-19 16:59:44 -07:00
Kyle Evans f187d6dfbf base: remove if_wg(4) and associated utilities, manpage
After length decisions, we've decided that the if_wg(4) driver and
related work is not yet ready to live in the tree.  This driver has
larger security implications than many, and thus will be held to
more scrutiny than other drivers.

Please also see the related message sent to the freebsd-hackers@
and freebsd-arch@ lists by Kyle Evans <kevans@FreeBSD.org> on
2021/03/16, with the subject line "Removing WireGuard Support From Base"
for additional context.
2021-03-17 09:14:48 -05:00
Emmanuel Vadot 060f0a17bb Revert "include: Remove symlink installation"
This reverts commit 0006530aa1.
2021-03-16 08:40:59 +01:00
Emmanuel Vadot 35b6d9b65e Revert "include: Tag directly the last headers"
This reverts commit 839fc8cdf9.
2021-03-16 08:40:54 +01:00
Emmanuel Vadot 839fc8cdf9 include: Tag directly the last headers
We cannot easily used the TAG here and we don't yet have something to install
even .h from a diretory in bsd.prog.mk

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D29170
MFC after:      2 weeks
2021-03-16 07:13:00 +01:00
Emmanuel Vadot 0006530aa1 include: Remove symlink installation
headers could be installed as symlink to the source tree instead of copies.
Remove the possibility to do that.
This make the makefile easier to read and to maintain and also don't duplicate
code.

While here remove some directories from LSBUDIRS as we already install them using
the INCS stuff.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D29167
MFC after:      2 weeks
2021-03-16 07:12:53 +01:00
Emmanuel Vadot 0594b28795 pkgbase: Install all cam includes with INCS
Now they are correctly taggued and put into the -dev package

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D29166
MFC after:      2 weeks
2021-03-16 07:12:49 +01:00
Emmanuel Vadot 8c3eaf244a pkgbase: Install all BSM includes with INCS
Now they are correctly taggued and put them into the libbsm package

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D29165
MFC after:      2 weeks
2021-03-16 07:12:46 +01:00
John Baldwin 283352dd4f Stop installing kernel-only crypto headers to /usr/include/crypto.
The only user-facing header from OCF is <crypto/cryptodev.h>.

PR:		254167 (exp-run)
MFC after:	1 week
Sponsored by:	Chelsio Communications
2021-03-15 17:00:21 -07:00
Kyle Evans 74ae3f3e33 if_wg: import latest fixup work from the wireguard-freebsd project
This is the culmination of about a week of work from three developers to
fix a number of functional and security issues.  This patch consists of
work done by the following folks:

- Jason A. Donenfeld <Jason@zx2c4.com>
- Matt Dunwoodie <ncon@noconroy.net>
- Kyle Evans <kevans@FreeBSD.org>

Notable changes include:
- Packets are now correctly staged for processing once the handshake has
  completed, resulting in less packet loss in the interim.
- Various race conditions have been resolved, particularly w.r.t. socket
  and packet lifetime (panics)
- Various tests have been added to assure correct functionality and
  tooling conformance
- Many security issues have been addressed
- if_wg now maintains jail-friendly semantics: sockets are created in
  the interface's home vnet so that it can act as the sole network
  connection for a jail
- if_wg no longer fails to remove peer allowed-ips of 0.0.0.0/0
- if_wg now exports via ioctl a format that is future proof and
  complete.  It is additionally supported by the upstream
  wireguard-tools (which we plan to merge in to base soon)
- if_wg now conforms to the WireGuard protocol and is more closely
  aligned with security auditing guidelines

Note that the driver has been rebased away from using iflib.  iflib
poses a number of challenges for a cloned device trying to operate in a
vnet that are non-trivial to solve and adds complexity to the
implementation for little gain.

The crypto implementation that was previously added to the tree was a
super complex integration of what previously appeared in an old out of
tree Linux module, which has been reduced to crypto.c containing simple
boring reference implementations.  This is part of a near-to-mid term
goal to work with FreeBSD kernel crypto folks and take advantage of or
improve accelerated crypto already offered elsewhere.

There's additional test suite effort underway out-of-tree taking
advantage of the aforementioned jail-friendly semantics to test a number
of real-world topologies, based on netns.sh.

Also note that this is still a work in progress; work going further will
be much smaller in nature.

MFC after:	1 month (maybe)
2021-03-14 23:52:04 -05:00
Scott Long afbee98232 Remove xform_poly1305.h from the build, it is not necessary. 2021-03-05 21:28:10 +00:00
Konstantin Belousov 3ae8d83d04 Remove __NO_TLS.
All supported platforms support thread-local vars and __thread.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28796
2021-02-23 20:08:10 +02:00
Alex Richardson 74eb7f97ec Fix make includes path to nvpair.h
Fixes a typo introduced in 9e5787d228
2021-01-19 21:23:25 +00:00
Alex Richardson 8d30571d45 include: Delete stale symlinks using find(1) instead of a shell loop.
This reduces the number of execve() syscalls during make includes by 88.

Reviewed By:	jhb
Differential Revision: https://reviews.freebsd.org/D27622
2021-01-19 21:23:25 +00:00
Warner Losh a21def4d56 pccard: Remove wi(4) driver
Remove wi(4). pccard is going away, and wi only supports PC Card
devices, though it has a minor amount of glue to also support
PCI cards. However, removing the one without removing the other
is hard, so the whole driver is being removed.

Relnotes: Yes
2021-01-07 20:41:06 -07:00
Vladimir Kondratyev 9477390796 hid: Import hidraw(4) - driver for access to raw HID device data
This driver provides raw access to HID devices through uhid(4)-compatible
interface and is based on pre-8.x uhid(4) code. Unlike uhid(4) it does
not take devices in to monopoly ownership and allows parallel access
from other drivers.

hidraw supports Linux's hidraw-compatible interface as well.

Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D27992
2021-01-08 02:18:43 +03:00
Vladimir Kondratyev 67de2db262 Factor-out hardware-independent part of USB HID support to new module
It will be used by the upcoming HID-over-i2C implementation.  Should be
no-op, except hid.ko module dependency is to be added to affected drivers.

Reviewed by:	hselasky, manu
Differential revision:	https://reviews.freebsd.org/D27867
2021-01-08 02:18:42 +03:00
Alex Richardson 7b0d3a3ccf include: Use printf(1) instead of shell loops for header symlinks
Using a shell for loop means we have to spawn a separate install(1)
process for each header that is symlinked. This patch uses printf(1) to
generate an argument list that has been prefixed with the correct number
of ../ and then uses a single install(1) invocation.

This reduces the number of execve() calls during make includes from 2442
(with D27622) to 1382. Running `make symlinks` in include/ now spawns 214
processes instead of 1276 without this patch.

Reviewed By:	jhb
Differential Revision: https://reviews.freebsd.org/D27723
2021-01-07 09:26:22 +00:00
Emmanuel Vadot f61a3898bb include: Use INCSGROUPS for a few files
Instead of using install directly use INCSGROUPS for them.
All those files are the ones we installed when the directory have more .h
files that we don't want to install so they aren't using the LSUBDIR stuff.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D27612
2021-01-04 16:36:43 +01:00
Emmanuel Vadot b6cc69322a include: Tag the last includes files as part of the -dev package
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D27618
2021-01-04 16:36:39 +01:00
Konstantin Belousov 7d7fad7bd9 Add tcgetwinsize(3) and tcsetwinsize(3) to termios
These functions get/set tty winsize respectively, and are trivial wrappers
around corresponding termio ioctls.

The functions are expected to be a part of POSIX.1 issue 8:
https://www.austingroupbugs.net/view.php?id=1151#c3856.
They are currently available in NetBSD and in musl libc.

PR:	251868
Submitted by:	Soumendra Ganguly <soumendraganguly@gmail.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27650
2020-12-25 20:43:09 +02:00
Konstantin Belousov 65bf304336 Change POSIX compliance level for visibility of strerror_l(3).
Third-party code tests for strerror_l(3) without specifying
_POSIX_SOURCE, and then expects that the function is prototyped with
_POSIX_SOURCE set to 200112.

Reported and tested by:	antoine
Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
2020-12-17 17:08:25 +00:00
Konstantin Belousov 675079b1ea Implement strerror_l().
Only for the arches that provide user-mode TLS.

PR: 251651
Requested by:	yuri
Discussed with:	emaste, jilles, tijl
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D27495
MFC after:	2 weeks
2020-12-16 09:02:09 +00:00
Thomas Munro cc7edd258c Add collation version support to querylocale(3).
Provide a way to ask for an opaque version string for a locale_t, so
that potential changes in sort order can be detected.  Similar to
ICU's ucol_getVersion() and Windows' GetNLSVersionEx(), this API is
intended to allow databases to detect when text order-based indexes
might need to be rebuilt.

The CLDR version is extracted from CLDR source data by the Makefile
under tools/tools/locale, written into the machine-generated Makefile
under shared/colldef, passed to localedef -V, and then written into
LC_COLLATE file headers.  The initial version is 34.0.
tools/tools/locale was recently updated to pull down 35.0, but the
output hasn't been committed under share/colldef yet, so that will
provide the first observable change when it happens.  Other versioning
schemes are possible in future, because the format is unspecified.

Reviewed by:	bapt, 0mp, kib, yuripv (albeit a long time ago)
Differential Revision:	https://reviews.freebsd.org/D17166
2020-11-08 02:50:34 +00:00
Warner Losh 60b426f46c Remove obsolete check for GCC < 3 and support for Intel Compiler
We no longer support old versions of GCC. Remove this check by
assuming it's false. That will make the entire expression false.  Also
remove support for Intel compiler, it's badly bitrotted.  Technically,
this removes support for C89 and K&R from compilers that don't define
_Bool in those compilation environments as well. I'm unaware of any
working compiler today for which that would be relevant (pcc has it
and tcc sadly isn't working for other reasons), though if one
pops up in ports, I'll work to resolve the issue.
2020-10-24 23:21:06 +00:00
Stefan Eßer 34b38e1245 Add search of LOCALBASE/share/calendar for calendars supplied by a port.
Calendar files in LOCALBASE override similarily named ones in the base
system. This could easily be changed if the base system calendars should
have precedence, but it could lead to a violation of POLA since then the
port's files were ignored unless those in base have been deleted.

There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses
of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease
a consistent modification of this prefix.

Reviewed by:	imp, pfg
Differential Revision:	https://reviews.freebsd.org/D26882
2020-10-23 09:22:23 +00:00
Xin LI 5011fb430a Further refinements of ptsname_r(3) interface:
- Hide ptsname_r under __BSD_VISIBLE for now as the specification
   is not finalized at this time.
 - Keep Symbol.map sorted.
 - Avoid the interposing of ptsname_r(3) from an user application
   from breaking ptsname(3) by making the implementation a static
   method and call the static function from ptsname(3) instead.

Reported by:	kib
Reviewed by:	kib, jilles
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26845
2020-10-20 01:29:45 +00:00
Xin LI 3e7224dffe Implement ptsname_r.
MFC after:	2 weeks
PR:		250062
Reviewed by:	jilles, 0mp, Ray <i maskray me>
Differential Revision:	https://reviews.freebsd.org/D26647
2020-10-17 04:14:38 +00:00
Brandon Bergren b963e10d68 [PowerPC64LE] Ensure nvram is built on powerpc64le.
Fix some cases where conditionals that were trying to exclude powerpcspe
were also excluding powerpc64le.

Sponsored by:	Tag1 Consulting, Inc.
2020-09-13 18:24:15 +00:00
Kyle Evans 69112cca60 getlogin_r: fix the type of len
getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our
version to do the same, bump the symbol version due to ABI change and
provide compat.

This was reported to break compilation of Ruby 2.8.

Some discussion about the necessity of the ABI compat did take place in the
review. While many 64-bit platforms would likely be passing it in a 64-bit
register and zero-extended and thus, not notice ABI breakage, some do
sign-extend (e.g. mips).

PR:		247102
Submitted by:	Bertram Scharpf <software@bertram-scharpf.de> (original)
Submitted by:	cem (ABI compat)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26335
2020-09-09 18:07:13 +00:00
Matt Macy 9e5787d228 Merge OpenZFS support in to HEAD.
The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.

I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.

Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.

Improvements include:
  project quotas, encrypted datasets,
  allocation classes, vectorized raidz,
  vectorized checksums, various command line
  improvements, zstd compression.

Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.

Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D25872
2020-08-25 02:21:27 +00:00
Kyle Evans 7c5ec5fe6a <regex.h>: reserve a regcomp field for REG_POSIX
For libc regcomp, this will be a nop. libregex will take this to mean that
it needs to turn off GNU extensions, effectively switching it back to the
POSIX-compliant libc implementation at runtime.
2020-07-31 12:40:31 +00:00
Konstantin Belousov aeafed21c4 Make CLOCK_REALTIME and TIMER_ABSTIME available for XOPEN_SOURCE >= 500.
Reported by:	jbeich
PR:	247701
Reviewed by:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D25554
2020-07-14 20:23:27 +00:00