libc: add posix_spawnattr_{get,set}execfd_np(3)
If execfd is set, the fexecve(2) is used by posix_spawn() instead of the
provided path.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54862
Bump __FreeBSD_version to 1600011 after changes to eventfd
This covers the commits that updated the API and the commit that exposes
that API in linuxkpi for DRM drivers.
Sponsored by: The FreeBSD Foundation
linuxkpi: Add eventfd_*()
Add <linux/eventfd.h> and expose the `eventfd_*()` API. This is used by
DRM drivers for some time, but the code was commented out so far.
Note that Linux uses `struct eventfd_ctx`, but FreeBSD defines `struct
eventfd`. We define `eventfd_ctx` as a synonym to `eventfd`.
Reviewed by: christos, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50853
eventfd: Add eventfd_signal()
The `eventfd_signal()` function is the equivalent to a write to an
eventfd file descriptor: it bumps the internal counter and wakes up
processes waiting for it.
`eventfd_signal()` is meant to be used by kernel drivers. DRM drivers
will call it through linuxkpi.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50850
eventfd: Add refcounting
An eventfd file descriptor can be used by drivers such as DRM drivers
through linuxkpi. A driver can hold a reference to such a file
regardless of the fact it is used by userland or not.
This patch introduces a refcount in `struct eventfd`, plus the
`eventfd_get()` and `eventfd_put()` functions to acquire and release
references. These functions will be used by DRM drivers for instance.
This structure is internal to `sys/kern/sys_eventfd.c` and not used
anywhere else. Thus it is safe to add a field without breaking anything.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50849
lib/libsys, lib/libc: export pdwait
Make pdwait(2) cancellable, same as all other wait*(2) syscalls wrappers.
Reviewed by: asomers, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54592
kern/kern_fork/exit.c: organize includes
Remove sys/cdefs.h.
Remove sys/param.h.
Order the sys/*.h includes alphabetically.
Reviewed by: asomers, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54592
freebsd32_rusage_out(): bzero the compat32 structure
There is some padding on non-x86. Unconditionally bzero the memory to
avoid a leak.
Noted by: markj
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54592
netlink: make compile without VIMAGE
Add the #include for proc.h which seems to be there in the VIMAGE
case through some other includes only.
Sponsored by: The FreeBSD Foundation
Fixes: 04f6b99947d2