summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2024-05-24sndio: Add a display string to the sioctl_open APIAlexandre Ratchov
For hardware devices, add a server.device control with a single item and the device name as display string. Add the necessary sndioctl(1) bits to print it.
2024-05-18Add pathconfat(2): pathconf(2) but with at-fd and flags arguments,Philip Guenther
the latter supporting the ability to get timestamp resolution of symlinks. ok deraadt@ millert@
2024-04-15Add scandirat(3); from freebsdFlorian Obser
To be used in httpd(8) shortly to prevent toctu issues. This makes __fdopendir internally accessible to avoid unnecessary syscalls in scandirat(3). Suggested & diff by guenther suggested by & OK millert tweak & OK guenther OK tb, jca This rides the libc crank.
2024-03-01Add mkdtemps(3), like mkdtemp(3) but with a suffix.Todd C. Miller
OK deraadt@ tb@
2024-02-04Move ctype.h defines to the _CTYPE_ prefix, avoids clashes with identifiers ↵Jeremie Courreges-Anglas
in ports Even if those _[BCNLPSUX] defines are in the reserved namespace, some ports make use of those identifiers and thus need pointless headscratching and patches. Just use a longer reserved prefix. We can't just #undef those defines as they are used in libc. Change similar to what NetBSD did around 2010. Went through base builds and an amd64 bulk build, the only fallout was lib(e)stdc++ base_ctype.h. "make includes" will install the latest ctype.h and libstdc++ ctype_base.h. "makes sense" deraadt@, ok sthen@ tb@
2023-12-12remove support for syscall(2) -- the "indirection system call" becauseTheo de Raadt
it is a dangerous alternative entry point for all system calls, and thus incompatible with the precision system call entry point scheme we are heading towards. This has been a 3-year mission: First perl needed a code-generated wrapper to fake syscall(2) as a giant switch table, then all the ports were cleaned with relatively minor fixes, except for "go". "go" required two fixes -- 1) a framework issue with old library versions, and 2) like perl, a fake syscall(2) wrapper to handle ioctl(2) and sysctl(2) because "syscall(SYS_ioctl" occurs all over the place in the "go" ecosystem because the "go developers" are plan9-loving unix-hating folk who tried to build an ecosystem without allowing "ioctl". ok kettenis, jsing, afresh1, sthen
2023-12-08Make sure TIB_INIT correctly initializes tib_thread_flags; regressionMiod Vallat
introduced in 1.3, causing sporadic pthread_main_np() erroneous results (and possibly more subtle problems). With and ok kurt@
2023-09-05According to the C11 standard, char32_t and char16_t are not partIngo Schwarze
of the C language but are part of the C library and have to be declared in <uchar.h> - see paragraph 7.28.2. In stark contrast, according to the C++11 standard, char32_t and char16_t are part of the C++ language, namely, keywords - see paragraph 2.12.1. Consequently, they must not be declared in a header file. To resolve this vile contradiction, use the predefined macro __cplusplus to find out which language is in use for the current compilation unit - see C11 paragraph 6.10.8.3 and C++11 paragraph 16.8.1. Reminded of the problem by naddy@. OK naddy@ who tested in make build / make release. Looks reasonable to millert@.
2023-08-20Provide C11 <uchar.h>.Ingo Schwarze
OK millert@. Tested by naddy@ in a bulk and by matthieu@ in the new foot(1) port. I originally wrote the code in 2022 at the prodding of espie@. Using one improvement to a manual page from jmc@.
2023-01-07Add {get,set}thrname(2) for putting thread names in the kernel andPhilip Guenther
exposed in a new field returned by sysctl(KERN_PROC). Update pthread_{get,set}_name_np(3) to use the syscalls. Show them, when set, in ps -H and top -H output. libc and libpthread minor bumps ok mpi@, mvs@, deraadt@
2023-01-04Christos Zoulas agreed to rescind clause 3 and 4 inJonathan Gray
NetBSD fsck.8 rev 1.35 fsutil.h rev 1.14 pathnames.h rev 1.2 netgroup_mkdb.8 rev 1.9 netgroup_mkdb.c rev 1.18 str.c rev 1.7 str.h rev 1.4 rdate.8 rev 1.11 rdate.c rev 1.19 extern.h rev 1.14 getnetgrent.c rev 1.41 netgroup.h rev 1.10 fparseln.3 rev 1.4 fparseln.c rev 1.10 our stringlist.c/stringlist.h are derived from getnetgrent.c rfc868time.c from rdate.c newfs/pathnames.h from fsck/pathnames.h https://mail-index.netbsd.org/source-changes/2009/10/21/msg002182.html Not all files are covered as some had copyright assigned to TNF in 1998.
2022-12-27spelling fixes; from paul tagliamonteJason McIntyre
2022-10-25Move CLOCKS_PER_SEC to sys/_time.h so the kernel has access to it.Todd C. Miller
This will be used in waitid(2) to set si_utime and si_stime. The definition of struct timespec also moves from time.h to sys/_time.h for struct itimerspec. OK kettenis@
2022-08-31Remove now unused and unreferenced disktab.h.Kenneth R Westerback
2022-08-30Nuke disktab.h references in preparation for nuking disktab.h.Kenneth R Westerback
disktab.h has not been used or useful for a looooong time. Detailed historical research by jsg@. ok jsg@ deraadt@
2022-08-20Add #define for RTLD_NOLOAD missed in last ld.so commit.Theo Buehler
2022-07-31POSIX 2008 TC2 requires <inttypes.h> to provide wchar_tPhilip Guenther
ok kettenis@ espie@
2022-07-15Add a new clnt*_control CLSET_CONNECTED, which says the socket has alreadyTheo de Raadt
been connected. In the udp case, this means to use send(), not sendto() ok jmatthew, claudio, miod
2022-04-29Add sio_flush(3) function to stop playback immediatelyAlexandre Ratchov
The new sio_flush(3) functions works the same way as sio_stop(3), except that it doesn't wait for play buffer to be drained. Instead, it discards its contents and returns immediately.
2022-03-01add rtable capability to login.conf.Ted Unangst
from Matthew Martin
2022-02-14Mark all the rpc 'ops' vectors, for auth, client, service, and xdr,Philip Guenther
as const, moving them from .data to .data.rel.ro. The other BSDs did this a long time ago; NetBSD did a chunk in 1998, which is long enough I didn't bother to get exact dates for others. ok deraadt@ millert@
2022-02-10introduce support for storing capability databases in /etc/login.conf.d;Robert Nagy
anytime a class is looked up, the /etc/login.conf.d/${class} file will be checked first for a matching class definition; this will allow us to easily add custom login classes from packages ok millert@
2022-01-28When it's the possessive of 'it', it's spelled "its", without thePhilip Guenther
apostrophe. one from miod, other by "never just one" vibe
2022-01-05funopen(): change seekfn argument to use off_t, not fpos_tTodd C. Miller
On BSD, fpos_t is typedef'd to off_t but some systems use a struct. This means fpos_t is not a portable function argument or return value. Both FreeBSD and the Linux libbsd funopen() have switched to off_t for this--we should too. From Joe Nelson. OK deraadt@
2021-11-29Niels agreed to remove the advertising clause; switching theseDamien Miller
to 3-term BSD license.
2021-11-22Implement rfc6840 (AD flag processing) if using trusted name serversJeremie Courreges-Anglas
libc can't do DNSSEC validation but it can ask a "security-aware" resolver to do so. Let's send queries with the AD flag set when appropriate, and let applications look at the AD flag in responses in a safe way, ie clear the AD flag if the resolvers aren't trusted. By default we only trust resolvers if resolv.conf(5) only lists name servers on localhost - the obvious candidates being unwind(8) and unbound(8). For non-localhost resolvers, an admin who trusts *all the name servers* listed in resolv.conf(5) *and the network path leading to them* can annotate this with "options trust-ad". AD flag processing gives ssh -o VerifyHostkeyDNS=Yes a chance to fetch SSHFP records in a secure manner, and tightens the situation for other applications, eg those using RES_USE_DNSSEC for DANE. It should be noted that postfix currently assumes trusted name servers by default and forces RES_TRUSTAD if available. RES_TRUSTAD and "options trust-ad" were first introduced in glibc by Florian Weimer. Florian Obser (florian@) contributed various improvements, fixed a bug and added automatic trust for name servers on localhost. ok florian@ phessler@
2021-06-09Enable libexecinfo.mortimer
With some build plumbing help from jsg@ ok kettenis@ sthen@
2021-06-03secure_path(3) hasn't been called since we recognized the TOCTOU issues a fewTheo de Raadt
years back, so we can remove it. Since nothing in the ecosystem calls it, I am not cranking the libc major as required, surely another crank will come along soon. noticed by Dante Catalfamo ok millert
2021-06-02add RTLD_NODELETE supportSebastien Marie
if RTLD_NODELETE isn't POSIX, it is widely deployed: at least linux, freebsd, dragonfly, netbsd, solaris, illumos, apple, and fuchsia have it. ok kettenis@ on previous version with help from and ok guenther@ diff partially inspired from a diff from brad@
2021-01-21Rearrange variables in dump / restore to handle -fno-common.mortimer
Largely following the commit by mckusick in FreeBSD. ok naddy@
2021-01-02Move Makefiles for libc++ and libc++abi to gnu/lib in preparation for anPatrick Wildt
upcoming update to those, which will see both codebases heading into the gnu/llvm dumpster. Feedback from jsg@ ok deraadt@ kettenis@
2020-10-26Hook up agentx.h.Martijn van Duren
OK deraadt@
2020-10-20Align the basename(3) and dirname(3) prototypes with the POSIX spec:Christian Weisgerber
Both functions take a non-const parameter. Implementations may modify the passed string, even though ours do not. ok stsp@ deraadt@ millert@
2020-09-11add format string checking annotations for dprintf(3) and vdprintf(3)Christian Weisgerber
ok millert@ deraadt@
2020-09-06Use __STDC_VERSION__ instead of __ISO_C_VISIBLE to guard _Static_assert.Todd C. Miller
We need to test what the compiler supports, not what the C library provides. This prevents static_assert from being defined when compiling with the in-tree gcc (4.2.1) which does not support _Static_assert.
2020-09-05Add C11's static_assert.Anthony J. Bentley
tested in a bulk by naddy@ previously submitted by jsg@ and Martin Wanvik ok millert@
2020-07-14Fix TIB/TCB on powerpc64. Some bright sould decided that the TCB shouldMark Kettenis
be 8 bytes in the 64-bit ABI just like in the 32-bit ABI. But that means there is no "spare" word in the TCB that we can use to store a pointer to our struct pthread. So we have to treat powerpc64 special. Also recognize that the thread pointer points 0x7000 bytes after the TCB. Since the TCB is 8 bytes this means that TCB_OFFSET should be 0x7008. Pointed out by guenther@; ok deraadt@
2020-06-28Allow switching between alternate devices (-F option) with sndioctl(1)Alexandre Ratchov
2020-06-28Add a new SIOCTL_SEL control type to select one of a predefined set ofAlexandre Ratchov
mutually exclusive values. It's the same as SIOCTL_LIST except that exactly one list element may be selected.
2020-06-18Fix comments about sioctl_desc's maxval fieldAlexandre Ratchov
2020-05-10Use a double-underscore prefix for local variables declared in macrosPhilip Guenther
that have arguments. Document this requirement/recommendation in style(9) prompted by mpi@ ok deraadt@
2020-02-26Add API to control audio device parameters exposed by sndiod.Alexandre Ratchov
The API exposes controls of modern audio hardware and sndiod software volume knobs in a uniform way. Hardware knobs are exposed through sndiod. Multiple programs may use the controls at the same time without the need to continuously scan the controls. For now sndiod exposes only its own controls and the master output and input volumes of the underlying hardware (if any), i.e. those typically exposed by acpi volume keys. ok deraadt
2019-11-14RDIRS for libcbor and libfido2Damien Miller
2019-10-24Allow the caller of asr functions to create and use a specific context.Otto Moerbeek
Diff from eric@ and florian@, commiting on their behalf since they are absent and we want to ride the minor shlib bump.
2019-07-11add /usr/local/sbin. ok deraadt millertTed Unangst
2019-05-28Include pthread.h to make this header standalone (needs pthread_t and others)Jeremie Courreges-Anglas
Will get us rid of pointless patches in the ports tree. ok guenther@
2019-05-10Inroduce malloc_conceal() and calloc_conceal(). Similar to theirOtto Moerbeek
counterparts but return memory in pages marked MAP_CONCEAL and on free() freezero() is actually called.
2019-05-10ld.so boot cleanup support:Philip Guenther
- put functions and data which are only used before calling the executable's start function into their own page-aligned segments for unmapping (only done on amd64, arm64, armv7, powerpc, and sparc64 so far) - pass .init_array and .preinit_array functions an addition argument which is a callback to get a structure which includes a function that frees the boot text and data - sometimes delay doing RELRO processing: for a shared-object marked DF_1_INITFIRST do it after the object's .init_array, for the executable do it after the .preinit_array - improve test-ld.so to link against libpthread and trigger its initialization late libc changes to use this will come later ok kettenis@
2019-04-06unbreak make includes on non-clang archs after libobjc removalJonathan Gray
found the hard way by nayden@ ok deraadt@
2019-03-05Build and install a shared libLLVM, llvm-config and llvm includes.Jonathan Gray
This is required to build the radeonsi Mesa driver. ok patrick@