summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Get rid of MAXSENSORDEVICES. Gaps in sensordev lists are now handledderaadt2010-04-201-2/+7
| | | | | | | by returning ENXIO instead of ENOENT, to essentially indicate hotplug sensor that has gone away. Accessing beyond the end of the sensordev list still returns ENOENT, so that you can see there are no further devices. ok kettenis oga
* WARNINGS -> CAVEATS, and a little neccessary cleanup;jmc2010-04-011-13/+13
|
* describe better what KERN_PROC_ARGV and KERN_PROC_ENV return; ok jmc@otto2010-03-301-2/+9
|
* dispense with some wacky escape sequences;jmc2010-03-261-3/+3
|
* Fix glob(3) to correctly return an error when its buffer space isnicm2010-03-231-13/+11
| | | | | | | | | | exhausted and GLOB_BRACE is given. globexp2() was ignoring errors returned from lower levels. While here, change globexp2() to return its return value normally rather putting it in a int pointer then always returning 0. ok otto
* document PF_KEY; from sthen and myselfjmc2010-03-121-3/+17
| | | | | | issue reported by Toni Mueller ok markus
* explain KERN_NOSUIDCOREDUMP with less words and more precisionschwarze2010-03-011-6/+9
| | | | ok jmc@ deraadt@ guenther@
* Do not attempt to silently continue text for the last column of tablesschwarze2010-02-251-5/+3
| | | | | | | | | | | | | generated by .Bl -column .It <tab> on following lines. This is a workaround; fixing it properly in a way compatible with our old groff would require .Xo support for .Bl -column phrases in mandoc(1), which is too much work right now just to fix exactly this one place in our tree. ok jmc@ This commit fixes the last issue i'm aware of which prevented building our whole tree with mandoc. Not all pages format nicely yet, but none kill the build any more.
* fix the description of _SC_GETPW_R_SIZE_MAX; from Tim van der Molenjmc2010-02-221-4/+4
|
* Every .Bl requires .It, even when using -column.schwarze2010-02-181-13/+13
| | | | | | | Found by and unbreaking the build with mandoc(1). While here, properly escape blanks inside columns and use "backslash" instead of "back slash". OK jmc@
* Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependentmiod2010-02-031-3/+3
| | | | | | | files or directories when applicable. The inspiration and name of MACHINE_CPU come from NetBSD, although the way to provide it to Makefiles is completely different. ok kettenis@
* Better ERRORS section info; from Tim van der Molen. POSIX documentsmillert2010-01-191-7/+54
| | | | | other common errno values for opendir() whereas we just point the user to open() et al. OK jmc@
* Leave errno as-is if fstat(2) fails instead of masking the realmillert2010-01-191-3/+7
| | | | errno with ENOTDIR. From Tim van der Molen.
* Add support to sysconf(3) for the variables _SC_NPROCESSORS_CONF andsthen2010-01-152-3/+21
| | | | | | | _SC_NPROCESSORS_ONLN, implemented by AIX/Tru64/Solaris/Linux/SCO/FreeBSD/NetBSD. Bump libc minor. From Brad, ok deraadt@ guenther@
* Document hw.ncpufound and HW_NCPUFOUND.guenther2010-01-141-3/+22
| | | | | | | | Document the interpretation of the third and fourth levels of KERN_FILE2. Document that KERN_FILE and KERN_PROC are deprecated in favor of KERN_FILE2 and KERN_PROC2. ok and tweaks jmc@
* If a process receives two different signals while in readpassphrase, onlydtucker2010-01-131-13/+19
| | | | | | | the most recent one will be stored for later re-delivery. When the signal handlers are restored, all except the most recent signal will be lost. Replace the single variable with an array so signals are not lost. ok deraadt@
* Neither .Pp nor unqualified text are allowed at the top level of .Bl;schwarze2010-01-031-3/+2
| | | | | | | | instead, .It is required. Thus, move .Pp and text before the .Bl, and remove the .Pp altogether where it is not needed. Syntax errors found by mandoc(1), also required to fix the mandoc build; feedback and ok jmc@, and sobrado@ also supports the direction.
* Implement proper error handling for getgrent(3), getgrnam(3) and getgrgid(3).schwarze2009-12-191-27/+43
| | | | | | | | | | | | | | | | | | | 1) Distinguish normal end of data (like eof, YPERR_NOMORE, YPERR_KEY) from error conditions. 2) Save errno(2) and restore it in case of success, as suggested by deraadt@ and beck@. While this code is touched, * move the common code for the yp_first and yp_next calls after the respective if/else-block; note that free(data) is not needed in case of failure and that __ypcurrent = NULL does no harm after failing yp_first. * return 0, not NULL: the return value of grscan is int, not a pointer. This is the last part of the work done on getgrent.c during c2k9, heavily relying on the other improvements done at that time. This has been rotting in my tree far too long. "get it in" deraadt@; also lightly tested by simon@ some time ago
* Update the list of async-signal-safe functionsguenther2009-12-161-30/+110
| | | | | | | | | | Document that snprintf/vsnprintf/syslog_r() aren't async-signal-safe for floating-point Provide cursory documentation of SIGTHR Eliminate the NOTE section of the sigaction(2) manpage by merging the good bits into the STANDARDS section ok deraadt@
* sleep(3) is supposed to return zero when it sleeps the entire amountguenther2009-12-141-3/+3
| | | | ok deraadt@
* getcwd() is posix, not ansi; from Thomas Pfaffjmc2009-12-101-3/+3
| | | | ok millert
* Correct description of physically vs logically; spotted by Nickotto2009-11-271-4/+7
| | | | Guenther; ok jmc
* Add a signal for librthread to use for interthread ASTs for cancelationguenther2009-11-272-4/+6
| | | | | | and suspension. "get it in" deraadt@, tedu@, cheers by others
* Change ENOTSUP's strerror() to "Not supported"guenther2009-11-241-2/+2
| | | | | | | Provide C and Pig locale expansions for errno values from EAUTH to ENOTSUP ok millert@, mk@, go aheads from others who have other translations in the works
* Make the code example fit on an 80 char screen without wrapping.mk2009-11-231-3/+4
| | | | ok guenther (no word from the sunshine girls on the matter, though)
* replacing malloc/realloc dance, by only one reallocchl2009-11-211-3/+2
| | | | ok millert@
* remove unused variablechl2009-11-211-2/+1
| | | | ok deraadt@
* remove unused variablechl2009-11-211-2/+1
| | | | ok guenther@
* More shrinkage, a bit for ramdisks but mostly for static binaries:guenther2009-11-185-294/+397
| | | | | | | | | | | | | | | | | - wrap with #ifndef NO_LOG_BAD_DNS_RESPONSES libc code that uses p_class() and p_type() for diagnostics, then add that define to libstub to avoid pulling in res_debug_syms.o - split rcmd() and ruserok() into separate files, as nothing uses both - split readdir_r() to its own file - split syslog_r() from syslog(), as the latter needs localtime(); many binaries no longer need to pull in all the time code after this; switch from usleep() to nanosleep() while we're at it (The profit of analysis of -Wl,-M,--cref output) Chops 888kB from /bin and /sbin on i386 ok deraadt@, miod@
* simplify the code looking for + in the password database, after analysisderaadt2009-11-121-5/+4
| | | | of a false positive made by parfait; ok millert
* fix leaks in error cases found by parfaitjsg2009-11-111-3/+7
| | | | ok blambert@ miod@ deraadt@
* Fix the handle locking in stdio to use flockfile/funlockfilekurt2009-11-093-6/+7
| | | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.
* add ENOTSUP and bump libc minorjasper2009-10-261-1/+2
| | | | | discussed with a few ok deraadt@
* Back out previous commit, as it caused too much growth for the installguenther2009-10-223-7/+6
| | | | media to fit
* Fix the handle locking in stdio to use flockfile/funlockfileguenther2009-10-213-6/+7
| | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. ok kurt@, earlier version tested by sthen@ and jj@
* Add (again) support for divert sockets. They allow you to:michele2009-10-041-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | - queue packets from pf(4) to a userspace application - reinject packets from the application into the kernel stack. The divert socket can be bound to a special "divert port" and will receive every packet diverted to that port by pf(4). The pf syntax is pretty simple, e.g.: pass on em0 inet proto tcp from any to any port 80 divert-packet port 1 A lot of discussion have happened since my last commit that resulted in many changes and improvements. I would *really* like to thank everyone who took part in the discussion especially canacar@ who spotted out which are the limitations of this approach. OpenBSD divert(4) is meant to be compatible with software running on top of FreeBSD's divert sockets even though they are pretty different and will become even more with time. discusses with many, but mainly reyk@ canacar@ deraadt@ dlg@ claudio@ beck@ tested by reyk@ and myself ok reyk@ claudio@ beck@ manpage help and ok by jmc@
* I had not enough oks to commit this diff.michele2009-09-081-7/+1
| | | | Sorry.
* Add support for divert sockets. They allow you to:michele2009-09-081-2/+8
| | | | | | | | | | | | | | | | - queue packets from pf(4) to a userspace application - reinject packets from the application into the kernel stack. The divert socket can be bound to a special "divert port" and will receive every packet diverted to that port by pf(4). The pf syntax is pretty simple, e.g.: pass on em0 inet proto tcp from any to any port 80 divert-packet port 8000 test, bugfix and ok by reyk@ manpage help and ok by jmc@ no objections from many others.
* Don't stop traversing a directory hierarchy if we reach SHRT_MAX,millert2009-08-272-14/+27
| | | | | | | | just stop updating fts_level so we don't overflow it. This allows rm, find, etc to operate on very deep hierarchies. Consumers of fts(3) do need to be aware that the actual level may be larger than fts_level. During the next libc major bump we will make fts_level an int instead of a short. OK deraadt@
* must include <sys/types.h> before including <login_cap.h> or <bsd_auth.h>;schwarze2009-07-152-4/+6
| | | | | noticed by joao <salvatti at gmail dot com> on tech@; feedback and ok kettenis@ deraadt@ and reminded by jmc@
* getgrouplist(3) used to and ought to return 0 on success;schwarze2009-06-232-9/+17
| | | | | fixing a regression introduced in rev. 1.16 spotted by otto@; ok millert@ otto@
* document KERN_BUFCACHEPERCENT and KERN_MAXLOCKSPERUID; help/ok ogajmc2009-06-091-2/+10
|
* de-spaghetti:schwarze2009-06-071-36/+20
| | | | | | | | | | If code is used from exactly one place, don't jump back dozens of lines to reach it, only to "goto" back where you came from. Instead, simply put the code where it belongs. Also fixes a regression that crept in in rev. 1.30: After clearing the variable __ypmode, don't try to make decisions based on its former value. As a bonus, garbage collect the grname variable and the _ypmode enum type. ok millert@
* Add KERN_FILE2 sysctl analogous to KERN_PROC2 but for file structures,millert2009-06-071-2/+12
| | | | | along with vnode type-specific info to make it more useful for fstat(1). OK deraadt@
* No need to malloc, copy, have a single read access, and free right away.schwarze2009-06-071-18/+6
| | | | | | Thus, garbage collect one variable, one strdup, one free, two ifs, one else and a couple of assignments. No functional change. ok millert@
* The yp_bind(3) return code now distinguishes "YP not active" from "an errorschwarze2009-06-051-63/+60
| | | | | | | | | occurred". Based on this, decide to either bail or use the record as is. Prevents getgrnam(3) and friends from silently skipping YP records on system errors, for example when out of memory. Also, calling yp_get_default_domain once is enough. The first two switch cases are unchanged, just reindented. ok millert@
* When parsing a line stating with "+" or "-" in group(5),schwarze2009-06-051-62/+51
| | | | | | | | | check whether YP is active up front, not half-way through the parsing. This fixes the bug that group names starting with a dash (yuck!) were skipped when YP was not active, introduced in rev. 1.27. Besides, the code becomes easier to understand. The code inside the two switch cases is unchanged, just reindented. "looks good" millert@
* Recycle four ancient fields in the disklabel structure, replacing them withderaadt2009-06-041-4/+0
| | | | | | | | | | | | bounds information, ie. the zone of the disk that OpenBSD can use. Have each pre-disklabel parser (MBR, DPME, or per-arch MD disklabel parsers) figure out this area and pass it up to userland. Then, delete all the same disk parsing code from disklabel(8) since the kernel passes it up. Lots and lots of - signs in the disklabel(8) code. Tested on as many platforms as possible, the fallout will be repaired as time goes on. To test, use disklabel -d <drive> and validate that the bounds do not overlap any boot blocks. This same information is used by disklabel -A... OK for the concept from krw, miod, and drahn
* in case a handling a +groupname:*:: entry fails due to lack of memory,schwarze2009-06-041-2/+3
| | | | | do not just skip the entry, but report the error condition; ok millert@
* Ensure there is a statement after a label.jsg2009-06-031-1/+2
| | | | ok deraadt@