summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* nanosleep: loop tsleep(9) to ensure coverage of the full timeout range.cheloha2018-12-311-4/+5
| | | | | | | | | | | | 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@
* getgruid_r -> getgrgid_rtb2018-12-281-3/+3
| | | | from Lauri Tirkkonen
* document kern.pool_debug; ok tedu@anton2018-12-261-2/+20
|
* Restore the optimization for unbuffered I/O. The buffer needs tomillert2018-12-161-1/+31
| | | | | be reset before each call to __srefill(). Passes new regress. OK semarie@
* Back out rev 1.17 for now, it causes issues with python when buildingmillert2018-12-161-31/+1
| | | | databases/tdb from ports.
* Revisit the optimization for unbuffered I/O. We can use the buffermillert2018-12-141-1/+31
| | | | | | passed to fread(3) directly in the FILE * and call __srefill() in a loop without the memcpy(). This preserves the expected behavior in all cases. OK semarie@, "This is neat" tedu@
* Back out the optimization in rev 1.13, it does not update flags onmillert2018-12-141-16/+1
| | | | EOF or error. This caused a regression in the cPickle python extension.
* Improve speed for the multi-threaded case by reducing lock contention.otto2018-12-101-30/+21
| | | | tested by many; ok florian@
* style; OK ottoflorian2018-12-091-3/+3
|
* remove a stray line accidentally left behind in rev. 1.120;schwarze2018-12-051-3/+2
| | | | patch from Hiltjo Posthuma <hiltjo at codemadness dot org>
* remove double .Pp. oops - sorry for not spotting!jmc2018-11-291-2/+1
|
* Improve introduction so there is more clarity about the patterns ofderaadt2018-11-291-17/+17
| | | | unveil calls should follow. ok various, including jmc
* Refactor "find the right pool" code into a function. ok djm@ tb@otto2018-11-271-65/+34
|
* fold the contents of malloc.conf.5 into malloc.3 and sysctl.2,jmc2018-11-212-11/+125
| | | | | | now that there is essentially no malloc.conf; text tweaked by deraadt; ok otto deraadt
* Introducing malloc_usable_size() was a mistake. While some otherotto2018-11-215-110/+8
| | | | | | | | | | | libs have it, it is a function that is considered harmful, so: Delete malloc_usable_size(). It is a function that blurs the line between malloc managed memory and application managed memory and exposes some of the internal workings of malloc. If an application relies on that, it is likely to break using another implementation of malloc. If you want usable size x, just allocate x bytes. ok deraadt@ and other devs
* Fix compilation on alpha, where DEF_WEAK() really must be paired withguenther2018-11-191-2/+1
| | | | PROTO_NORMAL(). Problem noted by deraadt@
* delete the dns jackport experiment. it has no future.tedu2018-11-191-6/+2
|
* Implement malloc_usable_size(); ok millert@ deraadt@ and jmc@ for the man pageotto2018-11-185-8/+112
|
* Add new KERN_CPUSTATS sysctl(2) so we can identify offline CPUs.cheloha2018-11-171-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of hw.smt we need a way to determine whether a given CPU is "online" or "offline" from userspace. KERN_CPTIME2 is an array, and so cannot be cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS with an extensible struct. At the moment it's just KERN_CPTIME2 with a flags member, but it can grow as needed. KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are few (if any) packages in the wild still using the symbol so breakage in ports should be near zero. No other system inherited the symbol from BSDi, either. Then, use the new sysctl(2) in systat(1) and top(1): - systat(1) draws placeholder marks ('-') instead of percentages for offline CPUs in the cpu view. - systat(1) omits offline CPU ticks when drawing the "big bar" in the vmstat view. The upshot is that the bar isn't half idle when half your logical CPUs are disabled. - top(1) does not draw lines for offline CPUs; if CPUs toggle on or offline in interactive mode we redraw the display to expand/reduce space for the new/missing CPUs. This is consistent with what some top(1) implementations do on Linux. - top(1) omits offline CPUs from the totals when CPU totals are combined into a single line (the '-1' flag). Originally prompted by deraadt@. Discussed endlessly with deraadt@, ketennis@, and sthen@. Tested by jmc@ and jca@. Earlier versions also discussed with jca@. Earlier versions tested by jmc@, tb@, and many others. docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@, "Is your stuff in yet?" deraadt@