summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use a local numeric label to branch to the start of the function, instead ofmiod2009-11-011-2/+3
| | | | referencing it by name; silences a linker warning; no functional change.
* Two minor bug fixes rotting in my tree:schwarze2009-11-011-11/+8
| | | | | | | | | (1) When the second malloc in yp_next fails, do not leak the memory allocated by the first one. Same fix as yp_first.c rev. 1.9. (2) When compiled with YPMATCHCACHE, do not fail the lookup when reserving memory for the cache fails. Instead, just return the correct result without caching it. ok millert@
* s/Mhz/MHz/, MHz is a multiple of the SI unit hertz (whose symbol is Hz).sobrado2009-10-311-2/+2
|
* skip the \' formatting flag, grouping is not implemented; ok deraadt@naddy2009-10-281-1/+5
|
* more fallout from jasper's commit.jsg2009-10-281-2/+2
| | | | | | | Changing the size of the _sys_errlist array changes a libc interface so we need to crank major. kettenis@ agrees
* more rcsid/sccs cleanupderaadt2009-10-2842-223/+18
|
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-274-23/+5
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* We don't have an "Ap" macro so ".Fn execve() Ap d" is wrong, reword to removenicm2009-10-271-16/+15
| | | | | | it. ok jmc
* add ENOTSUP and bump libc minorjasper2009-10-263-4/+7
| | | | | discussed with a few ok deraadt@
* Back out previous commit, as it caused too much growth for the installguenther2009-10-2247-283/+139
| | | | media to fit
* Fix the handle locking in stdio to use flockfile/funlockfileguenther2009-10-2147-139/+283
| | | | | | | | | | | | 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@
* Check mmap return value against MAP_FAILED not NULL.pirofti2009-10-201-2/+2
| | | | Okay deraadt@, otto@.
* teach gdtoa & its subroutines that malloc can fail; in which casemartynas2009-10-1646-2989/+408
| | | | | | ecvt, fcvt, gcvt, *printf, strtof, strtod, strtold act per ieee 1003.1. after these massive changes, remove unused files which would not work now. reported by Maksymilian Arciemowicz; ok theo
* rewrite the history section, prompted by Paul Stoeber; ok deraadt@ jmc@otto2009-10-101-25/+28
|
* 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@
* Minor bump for safety, due to the mips cachectl() addition.miod2009-09-271-1/+1
|
* Add an implementation of IRIX-compatible cacheflush() routine to mips ports,miod2009-09-272-1/+39
| | | | | | | needed for gcc -ftrampoline operation as well as by some third-party software. Although the implementation uses the sysarch() sysctl, the wrapper is added to libc as it was a direct system call (which it is on IRIX).
* cvs log message from ed@freebsd, revision 197045:jmc2009-09-101-3/+3
| | | | | | | | | | | Make the description of `b' a little better. If you have a one-byte sequence, `w', `b' is the second character. Not the third. Submitted by: Christoph Mallon checked by otto
* maxzis -> maxsize; from Han Boetesjmc2009-09-091-3/+3
|
* 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.
* make getaddrinfo(3) accept numeric servname when ai_socktype is notfgsch2009-09-021-4/+2
| | | | | specified in hint or hints is NULL. claudio@ ok
* 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@
* add SF_ARCHIVED. ok millert@, tedu@martynas2009-08-201-4/+5
|
* various MLINK fixes from Alan R. S. Bueno;jmc2009-08-132-5/+5
|
* define substitution in some cases might happen after prototypes aremartynas2009-08-071-39/+39
| | | | | already pulled; so manually substitute protos ensuring they will always be right; ok millert@
* 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@
* Load symbol address with dla, not la; good thing userland is still limitedmiod2009-07-131-2/+2
| | | | to 2GB of vm space.
* fwrite() should also return 0 if either size or nmemb are 0.millert2009-07-123-8/+22
| | | | Adapted from FreeBSD. OK deraadt@
* promote correct style for error checkingeric2009-07-093-15/+15
| | | | ok tedu@ deraadt@ krw@
* 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@
* fix rcs ids. ok sthen@martynas2009-06-211-1/+1
|
* abs conforms c99 -> imaxabs conforms c99. ok millert@martynas2009-06-211-3/+3
|
* YP client functions do not allocate memory when they fail;schwarze2009-06-121-3/+4
| | | | wording tweaked by jmc@
* don't use freelist if it overruns; use heap memory instead notmartynas2009-06-111-2/+6
| | | | | trying to allocate large blocks from bss memory pool in this case. problem reported by Maksymilian Arciemowicz. ok otto@, millert@
* document KERN_BUFCACHEPERCENT and KERN_MAXLOCKSPERUID; help/ok ogajmc2009-06-091-2/+10
|
* quieten compiler by converting pointers to uintptr_t before truncating themderaadt2009-06-081-5/+5
| | | | | to u_int32_t to do integer math with (in a situation where that is legit) ok otto millert
* 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@
* fix a minor memory leak spotted by deraadt@; ok millert@ deraadt@schwarze2009-06-071-8/+6
|
* 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@
* Modify the uc_entries allocation check such that the lhs is a constant.millert2009-06-071-2/+2
| | | | 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@
* In case of memory exhaustion, ypmatch_add may both leak memory and leaveschwarze2009-06-061-36/+28
| | | | | | invalid data on the list, inviting later NULL pointer access. noticed by deraadt@, algorithm proposed by millert, implemented by me; feedback and ok millert@
* correct error codes after malloc(3) failure, as 0 means RPC_SUCCESS;schwarze2009-06-061-3/+3
| | | | noticed by and OK deraadt@, ok millert@
* use calloc() and realloc() more; ok schwarzederaadt2009-06-062-21/+13
|
* Note that f_fsid gets cleared when caller is not the superuser. OK deraadt@millert2009-06-052-4/+12
|
* use calloc() to provide size * nitems safetyderaadt2009-06-051-3/+2
|
* use calloc() to provide size * nitems safety; ok millertderaadt2009-06-051-3/+2
|
* 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@
* malloc(3) failure should raise YPERR_RESRC, not YPERR_YPERR;schwarze2009-06-051-3/+3
| | | | ok millert@