summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* in vdprintf(), no need to use the file locking mecanism when usingsemarie2019-03-031-2/+2
| | | | | | | fflush() as the variable is stack based (no possible concurrent access). call directly __sflush() ok visa@ deraadt@
* Consume one leading space with %e iff givenkn2019-02-212-7/+10
| | | | | | | | | 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
* New futex(2) based rwlock implementation based on the mutex code.mpi2019-02-131-1/+12
| | | | | | | | | 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@
* KNF.mpi2019-02-131-2/+2
| | | | Pointed out by pirofti@ while reviewing my rwlock impl. based on this one.
* Allow SO_PEERCRED to be called on sockets created with socketpair.martijn2019-02-131-4/+5
| | | | OK claudio@ and jca@
* Xr the byteorder funcs; from tim kuijstenjmc2019-02-131-3/+4
|
* Add lock stack trace saving for witness(4).visa2019-02-071-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Add manpage for timer* macros, actually document timespec* macros.cheloha2019-02-071-91/+3
| | | | | | | | | | | | | | 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@
* Fix typo in last commit.millert2019-02-051-2/+2
|
* Avoid an out of bounds read when regcomp() is passed a bad expression.millert2019-02-051-1/+5
| | | | | | | | 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@
* Make gl_pathc, gl_matchc and gl_offs size_t in glob_t to match POSIX.millert2019-02-043-26/+25
| | | | This requires a libc major version bump. OK deraadt@
* Remove unused <assert.h> header.mpi2019-01-291-2/+1
|
* There's no point in asserting that a pointer is not NULL beforempi2019-01-291-3/+1
| | | | | | dereferencing it. ok kettenis@, visa@
* Add a dedicated sysctl(2) node for witness(4).visa2019-01-291-4/+15
| | | | | | | | 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@
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-2541-100/+100
|
* strptime(3): Disallow double leap second.cheloha2019-01-221-2/+2
| | | | | | | | | | 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@
* sort sections, and add a missing verb to the EXAMPLES text;jmc2019-01-221-24/+24
|
* Wrap long lineotto2019-01-221-4/+4
|
* Point people to ipcomp(4) instead of ipsecctl(8) forajacoutot2019-01-221-3/+3
| | | | | | net.inet.ipcomp.enable. ok deraadt@ bluhm@
* strftime can print epoch seconds with %s, so allow strptime to parse it.tedu2019-01-212-4/+42
| | | | ok cheloha
* a few tweakstedu2019-01-211-5/+9
|
* Add example showing a proper comparison function, as many examples showotto2019-01-211-3/+40
| | | | the wrong idiom. ok tedu@ but probably needs some tweakin
* Document 'video' promise.landry2019-01-211-2/+27
| | | | looks fine to jmc@
* correct the RETURN VALUES of the macros, document the HISTORY ofschwarze2019-01-201-9/+37
| | | | | the macros, and simplify one wording; OK millert@, tweak and OK jmc@
* use standard headers for siphashbcook2019-01-201-4/+3
| | | | ok tedu@
* include stdint.h over sys/types.hbcook2019-01-201-2/+2
| | | | ok deraadt@ tedu@
* sys/time.h: new macros: timerisvalid() and timespecisvalid().cheloha2019-01-181-2/+10
| | | | | | | | | | | 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@
* Improve the description of locale dependency:schwarze2019-01-184-28/+40
| | | | | | | | * 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@
* Replace the vague, incorrect, and confusing BUGS sections with CAVEATSschwarze2019-01-183-12/+33
| | | | | | 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@.
* minor tweaks:schwarze2019-01-181-9/+17
| | | | | | * correctly mark up NULL * avoid gratuitous future tense * replace one wrong .Nm macro
* Adjust EINVAL wording: tv_nsec cannot be 1 billion, either.cheloha2019-01-181-3/+4
|
* futex(2): validate relative timeout before sleeping.cheloha2019-01-181-2/+7
| | | | | | | | Linux does validation. Document this new failure case as an EINVAL, like Linux. "stop waiting" deraadt
* adjtime(2), settimeofday(2), clock_settime(2): validate inputcheloha2019-01-182-6/+15
| | | | | | | | | 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@
* For all functions known to be infected by LC_NUMERIC, add shortschwarze2019-01-167-35/+63
| | | | | | | | 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@
* Unbreak tree. Last minute changes are evil.otto2019-01-142-4/+4
|
* There are cases where a program doing dns requests wants to set theotto2019-01-143-4/+10
| | | | | Checking Disabled flag. Introduce a RES flag to do so. ok krw@ deraadt@ eric@
* Warn against using any categories but LC_CTYPE in setlocale(3) andschwarze2019-01-131-3/+122
| | | | | | | 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@.
* Restore .Xr to pthread_sigmaskjca2019-01-131-3/+4
| | | | Pointed out by naddy@
* Move sigwait(3) from libpthread to libcjca2019-01-125-4/+156
| | | | | | | | 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.
* mincore() is a relic from the past, exposing physical machine informationderaadt2019-01-1113-98/+21
| | | | | | | 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
* Similar CAVEATS regarding LC_NUMERIC as was just committedschwarze2019-01-111-6/+19
| | | | | to wprintf(3) with OK cheloha@ tedu@; also triggered by a smaller diff from Jan Stary <hans at stare dot cz>.
* Clarify that OpenBSD ignores the dangerous category LC_NUMERIC,schwarze2019-01-111-16/+30
| | | | | | 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@.
* getsockopt(2) recv(2) rmdir(2) and send(2) were present and implementedjsg2019-01-114-12/+12
| | | | | | in 4.1c ok schwarze@
* Move default numer of pools in the multi-threaded case to 8. Various testsotto2019-01-101-2/+2
| | | | by me and others indicate that it is the optimum.
* Make the "not my pool" searching loop a tiny bit smarter, whileotto2019-01-103-25/+98
| | | | | | 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@
* make spelling in previous consistent within the page;jmc2019-01-091-3/+3
|
* Document SO_ZEROIZE socket option.bluhm2019-01-081-2/+9
| | | | OK claudio@
* Fix most of the .Li abuse:schwarze2019-01-061-47/+49
| | | | | | | | | * 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.
* note that tracefile must be null when clearing points.tedu2019-01-061-7/+4
| | | | ok kn
* Replace two-operand instruction aliases that clang does notvisa2019-01-051-2/+2
| | | | | | understand with the three-operand instructions. No binary change with gas.