summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2019-02-21Consume one leading space with %e iff givenkn
Since strftime(3)'s %e conversion specification preceeds single digits by a blank, do the converse here to allow safe data round trips through these functions with the same format string. Positive feedback tedu deraadt, OK millert jca
2019-02-13New futex(2) based rwlock implementation based on the mutex code.Martin Pieuchot
This implementation reduces contention because threads no longer need to spin calling sched_yield(2) before going to sleep. Tested by many, thanks! ok visa@, pirofti@
2019-02-13KNF.Martin Pieuchot
Pointed out by pirofti@ while reviewing my rwlock impl. based on this one.
2019-02-13Allow SO_PEERCRED to be called on sockets created with socketpair.Martijn van Duren
OK claudio@ and jca@
2019-02-13Xr the byteorder funcs; from tim kuijstenJason McIntyre
2019-02-07Add lock stack trace saving for witness(4).Visa Hankala
This lets witness(4) save a stack trace on each lock acquisition. The saved traces can be viewed in ddb(4) when showing the currently held locks, which may help when debugging incorrect locking. Sample output: ddb{0}> show all locks Process 63836 (rm) thread 0xffff8000221e52c8 (435004) exclusive rrwlock inode r = 0 (0xfffffd8119a092c0) locked @ /usr/src/sys/ufs/ufs/ufs_vnops.c:1547 #0 witness_lock+0x419 #1 _rw_enter+0x2bb #2 _rrw_enter+0x42 #3 VOP_LOCK+0x3f #4 vn_lock+0x36 #5 vfs_lookup+0xa1 #6 namei+0x2b3 #7 dounlinkat+0x85 #8 syscall+0x338 #9 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 1 (0xffffffff81e6a5f0) locked @ /usr/src/sys/arch/amd64/amd64/intr.c:525 #0 witness_lock+0x419 #1 syscall+0x2b6 #2 Xsyscall+0x128 The saving adds overhead, so it is not enabled by default. It can be taken into use by setting sysctl kern.witness.locktrace=1 at runtime or by defining WITNESS_LOCKTRACE in the kernel configuration. Feedback and OK anton@
2019-02-07Add manpage for timer* macros, actually document timespec* macros.cheloha
We use these all over the tree so they ought to be documented on a separate page; move them out of getitimer.2 into timeradd.3. While moving, clean up the language and markup here and there. Still needs to be added to share/man/man3/Makefile, pending any further cleanup in-tree. With input from schwarze@, jmc@, and millert@. "looks great" deraadt@, "(ok)" jmc@, ok tedu@, "we'll spruce it up in-tree" schwarze@
2019-02-05Fix typo in last commit.Todd C. Miller
2019-02-05Avoid an out of bounds read when regcomp() is passed a bad expression.Todd C. Miller
When an invalid regular expression is passed, seterr() is called which sets p->error to the appropriate error code and sets p->next and p->end to nuls[]. However, p->next is decremented in the default case in p_ere_exp() and p_simp_re() which makes it point to one byte before nuls[]. From FreeBSD. OK tedu@ deraadt@
2019-02-04Make gl_pathc, gl_matchc and gl_offs size_t in glob_t to match POSIX.Todd C. Miller
This requires a libc major version bump. OK deraadt@
2019-01-29Remove unused <assert.h> header.Martin Pieuchot
2019-01-29There's no point in asserting that a pointer is not NULL beforeMartin Pieuchot
dereferencing it. ok kettenis@, visa@
2019-01-29Add a dedicated sysctl(2) node for witness(4).Visa Hankala
The new node contains the subsystem's main control variable, kern.witness.watch. It is aliased by the old name, kern.witnesswatch. The alias will be removed in the future. OK anton@ mpi@
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.Todd C. Miller
2019-01-22strptime(3): Disallow double leap second.cheloha
POSIX allows for one extra second in a minute, i.e. "23:59:60", so that leap seconds can be parsed. They don't allow for *two* extra seconds, i.e. "23:59:61", though. Typo introduced in NetBSD lib/libc/time/strptime.c,v1.3. ok krw@ bcook@ tedu@
2019-01-22sort sections, and add a missing verb to the EXAMPLES text;Jason McIntyre
2019-01-22Wrap long lineOtto Moerbeek
2019-01-22Point people to ipcomp(4) instead of ipsecctl(8) forAntoine Jacoutot
net.inet.ipcomp.enable. ok deraadt@ bluhm@
2019-01-21strftime can print epoch seconds with %s, so allow strptime to parse it.Ted Unangst
ok cheloha
2019-01-21a few tweaksTed Unangst
2019-01-21Add example showing a proper comparison function, as many examples showOtto Moerbeek
the wrong idiom. ok tedu@ but probably needs some tweakin
2019-01-21Document 'video' promise.Landry Breuil
looks fine to jmc@
2019-01-20correct the RETURN VALUES of the macros, document the HISTORY ofIngo Schwarze
the macros, and simplify one wording; OK millert@, tweak and OK jmc@
2019-01-20use standard headers for siphashBrent Cook
ok tedu@
2019-01-20include stdint.h over sys/types.hBrent Cook
ok deraadt@ tedu@
2019-01-18sys/time.h: new macros: timerisvalid() and timespecisvalid().cheloha
Make it less likely you miss a zero when typing out 100000 or 100000000. Document them in getitimer.2 for the masses. These may be of use in library code as well as the kernel. Comparable inline functions exist in Linux but are not available to userspace like these. "OK." deraadt@
2019-01-18Improve the description of locale dependency:Ingo Schwarze
* mention LC_COLLATE; * clarify that all these functions are infested, including the *_l() versions; * avoid ENVIRONMENT, these functions don't inspect it; * and point to the C library functions that change the locale. OK millert@
2019-01-18Replace the vague, incorrect, and confusing BUGS sections with CAVEATSIngo Schwarze
clearly stating which arguments have to be avoided, and mention the header files defining the constants required for the checks. Feedback and OK guenther@, OK bluhm@.
2019-01-18minor tweaks:Ingo Schwarze
* correctly mark up NULL * avoid gratuitous future tense * replace one wrong .Nm macro
2019-01-18Adjust EINVAL wording: tv_nsec cannot be 1 billion, either.cheloha
2019-01-18futex(2): validate relative timeout before sleeping.cheloha
Linux does validation. Document this new failure case as an EINVAL, like Linux. "stop waiting" deraadt
2019-01-18adjtime(2), settimeofday(2), clock_settime(2): validate inputcheloha
Add documentation for the new EINVAL cases for adjtime(2) and settimeofday(2). adjtime.2 docs ok schwarze@, settimeofday(2)/clock_settime(2) stuff ok tedu@, "stop waiting" deraadt@
2019-01-16For all functions known to be infected by LC_NUMERIC, add shortIngo Schwarze
CAVEATS pointing to the new CAVEATS section in setlocale(3). Make those in wprintf(3) and wscanf(3) more concise since duplicate information is a bad idea. Incompleteness of information originally pointed out by millert@. OK millert@
2019-01-14Unbreak tree. Last minute changes are evil.Otto Moerbeek
2019-01-14There are cases where a program doing dns requests wants to set theOtto Moerbeek
Checking Disabled flag. Introduce a RES flag to do so. ok krw@ deraadt@ eric@
2019-01-13Warn against using any categories but LC_CTYPE in setlocale(3) andIngo Schwarze
list many (hopefully the most important) functions affected by the locale, such that the CAVEATS sections in individual manual pages can be kept shorter in the future; basic idea from millert@; feedback and OK jmc@; OK deraadt@.
2019-01-13Restore .Xr to pthread_sigmaskJeremie Courreges-Anglas
Pointed out by naddy@
2019-01-12Move sigwait(3) from libpthread to libcJeremie Courreges-Anglas
POSIX wants it in libc, that's where the function can be found on other systems. Reported by naddy@, input from naddy@ and guenther@. "looks ok" guenther@, ok deraadt@ Note: riding the libc/libpthread major cranks earlier today.
2019-01-11mincore() is a relic from the past, exposing physical machine informationTheo de Raadt
about shared resources which no program should see. only a few pieces of software use it, generally poorly thought out. they are being fixed, so mincore() can be deleted. ok guenther tedu jca sthen, others
2019-01-11Similar CAVEATS regarding LC_NUMERIC as was just committedIngo Schwarze
to wprintf(3) with OK cheloha@ tedu@; also triggered by a smaller diff from Jan Stary <hans at stare dot cz>.
2019-01-11Clarify that OpenBSD ignores the dangerous category LC_NUMERIC,Ingo Schwarze
and explain best practice for portable programs below CAVEATS. Triggered by a smaller diff from Jan Stary <hans at stare dot cz>. Emphatic OKs from cheloha@ and tedu@.
2019-01-11getsockopt(2) recv(2) rmdir(2) and send(2) were present and implementedJonathan Gray
in 4.1c ok schwarze@
2019-01-10Move default numer of pools in the multi-threaded case to 8. Various testsOtto Moerbeek
by me and others indicate that it is the optimum.
2019-01-10Make the "not my pool" searching loop a tiny bit smarter, whileOtto Moerbeek
making the number of pools variable. Do not document the malloc conf settings atm, don't know yet if they will stay. Thanks to all the testers. ok deraadt@
2019-01-09make spelling in previous consistent within the page;Jason McIntyre
2019-01-08Document SO_ZEROIZE socket option.Alexander Bluhm
OK claudio@
2019-01-06Fix most of the .Li abuse:Ingo Schwarze
* Use .Vt for struct names and other type names like in_port_t. * Use .Dv for #define'd constants like CPUSTATES and KERN_SYSVIPC_INFO. * Use .Va for sysctl variable names like "machdep". Not touching some of the .Li use related to networking; that stuff looks suspicious in more than one way and a diff would need review.
2019-01-06note that tracefile must be null when clearing points.Ted Unangst
ok kn
2019-01-05Replace two-operand instruction aliases that clang does notVisa Hankala
understand with the three-operand instructions. No binary change with gas.
2018-12-31nanosleep: loop tsleep(9) to ensure coverage of the full timeout range.cheloha
tsleep(9)'s maximum timeout shrinks as HZ grows, so this ensures we do not return early from longer timeouts on alpha or on custom kernels. POSIX says you cannot return early unless a signal is delivered, so this makes us more compliant with the standard. While here, remove the 100 million second upper bound. It is an artifact from itimerfix() and it serves no discernible purpose. ok tedu@ visa@