summaryrefslogtreecommitdiff
path: root/lib/libc/gen
AgeCommit message (Collapse)Author
2009-11-23Make the code example fit on an 80 char screen without wrapping.Michael Knudsen
ok guenther (no word from the sunshine girls on the matter, though)
2009-11-21replacing malloc/realloc dance, by only one reallocCharles Longeau
ok millert@
2009-11-21remove unused variableCharles Longeau
ok deraadt@
2009-11-21remove unused variableCharles Longeau
ok guenther@
2009-11-18More shrinkage, a bit for ramdisks but mostly for static binaries:Philip Guenthe
- 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@
2009-11-12simplify the code looking for + in the password database, after analysisTheo de Raadt
of a false positive made by parfait; ok millert
2009-11-11fix leaks in error cases found by parfaitJonathan Gray
ok blambert@ miod@ deraadt@
2009-11-09Fix the handle locking in stdio to use flockfile/funlockfileKurt Miller
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.
2009-10-26add ENOTSUP and bump libc minorJasper Lievisse Adriaanse
discussed with a few ok deraadt@
2009-10-22Back out previous commit, as it caused too much growth for the installPhilip Guenthe
media to fit
2009-10-21Fix the handle locking in stdio to use flockfile/funlockfilePhilip Guenthe
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@
2009-10-04Add (again) support for divert sockets. They allow you to:Michele Marchetto
- 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@
2009-09-08I had not enough oks to commit this diff.Michele Marchetto
Sorry.
2009-09-08Add support for divert sockets. They allow you to:Michele Marchetto
- 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.
2009-08-27Don't stop traversing a directory hierarchy if we reach SHRT_MAX,Todd C. Miller
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@
2009-07-15must include <sys/types.h> before including <login_cap.h> or <bsd_auth.h>;Ingo Schwarze
noticed by joao <salvatti at gmail dot com> on tech@; feedback and ok kettenis@ deraadt@ and reminded by jmc@
2009-06-23getgrouplist(3) used to and ought to return 0 on success;Ingo Schwarze
fixing a regression introduced in rev. 1.16 spotted by otto@; ok millert@ otto@
2009-06-09document KERN_BUFCACHEPERCENT and KERN_MAXLOCKSPERUID; help/ok ogaJason McIntyre
2009-06-07de-spaghetti:Ingo Schwarze
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@
2009-06-07Add KERN_FILE2 sysctl analogous to KERN_PROC2 but for file structures,Todd C. Miller
along with vnode type-specific info to make it more useful for fstat(1). OK deraadt@
2009-06-07No need to malloc, copy, have a single read access, and free right away.Ingo Schwarze
Thus, garbage collect one variable, one strdup, one free, two ifs, one else and a couple of assignments. No functional change. ok millert@
2009-06-05The yp_bind(3) return code now distinguishes "YP not active" from "an errorIngo Schwarze
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@
2009-06-05When parsing a line stating with "+" or "-" in group(5),Ingo Schwarze
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@
2009-06-04Recycle four ancient fields in the disklabel structure, replacing them withTheo de Raadt
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
2009-06-04in case a handling a +groupname:*:: entry fails due to lack of memory,Ingo Schwarze
do not just skip the entry, but report the error condition; ok millert@
2009-06-03Ensure there is a statement after a label.Jonathan Gray
ok deraadt@
2009-06-03Take advantage of the surprise libc bump to bring inIngo Schwarze
YP group(5) exclusion, i.e. support -groupname:*:: in /etc/group. Such groups will be excluded from later +:*::, in just the same was as it is already done for passwd(5). I have been running this since the autumn of 2008. Discussed with several (including deraadt@, millert@, jmc@).
2009-06-02tweak previous;Jason McIntyre
2009-06-01Split getpw{nam,uid} off into their own man page. Hopefully, thisTodd C. Miller
will help people understand that endpwent() is not normally needed. OK deraadt@ jmc@
2009-04-29document that bogus lines are silently ignoredTheo de Raadt
ok millert
2009-04-29Remove the stderr spray balony. Library functions should indicate failureTheo de Raadt
(and libc and some others can use errno to indicate more detailed results). They should not print trash to stderr, let alone assume that stderr is open to the place they think it is. ok millert
2009-04-21remove from gen so that lint doesn't check gen if assembly versionsMartynas Venckus
are available. spotted by theo
2009-04-19- ldexp implementation has issues. switch to the one from libmMartynas Venckus
- remove frexp in hppa64, cloned from hppa - move generic ieee754 implementations of modf and ldexp to gen ok kettenis@, "looks good" millert@
2009-03-27supplement previous: add /etc/netid to FILES section; ok jmc@, ajacoutot@Ingo Schwarze
2009-03-27getgrouplist: If YP is #defined and enabled in /etc/group(5) and /etc/netid(5)Ingo Schwarze
contains a matching entry, use that and refrain from accessing YP. getpwnam/getpwuid: If YP is #defined and /etc/master.passwd(5) contains a matching entry before the first YP entry, use that and stay away from YP. Taken together, this allows a solution to the following problem pointed out by deraadt@: When YP was configured but temporarily unavailable, even root login would block, hindering you when trying to do repairs. To avoid this, you can now provide a static entry for root in /etc/netid. Using suggestions from miod@ otto@ blambert@ jmc@. "commit" deraadt@, "cool" ajacoutot@, "looks fine" jmc@.
2009-03-23add a HISTORY section to fts(3).Igor Sobrado
diff proposed by an anonymous user on bugs@; tweaked by jmc@; verified using the superb 4BSD collection at pdp-11.org.ru (thanks form@). ok jmc@
2009-03-05Add glob(7) and refer to it. OK jmc@ sobrado@Todd C. Miller
2009-02-18Add missing braces. This is why we use braces for indented block thatTodd C. Miller
are more than a couple of lines...
2009-02-11Avoid level going negative on deep (i mean really deep) dirs. ReportedOtto Moerbeek
by Maksymilian Arciemowicz. ok kettenis@ millert@
2009-01-15Remove support for kerb4 '.' instance separator, kerb4 is dead. OK jacekm@Todd C. Miller
2008-12-27Fix file descriptor leak in fts_children(); okay dhill@, millert@,Pedro Martelletto
tedu@, thib@.
2008-12-23ddb.console does not override machdep.kbdreset, so don't say it does;Jason McIntyre
2008-12-12- document and mlink frexpf, ldexpf, modff added 13 years agoMartynas Venckus
- document frexpl, ldexpl added recently a tweak and ok jmc@
2008-12-10use sys/cdefs.h; pointed out by theoMartynas Venckus
2008-12-09ditto frexpl and ldexplMartynas Venckus
2008-12-09- add long double signbitMartynas Venckus
- make long double versions weak aliases to double versions, on archs where long doubles are 64 bits - no need to have two finites. finite() and finitef() are non-standard 3BSD obsolete versions of isfinite. remove from libm. make them weak_alias in libc to __isfinite and __isfinitef instead. similarly make 3BSD obsolete versions of isinf, isinff, isnan, isnanf weak_aliases to C99's __isinf, __isinff, __isnan, __isnanf - bump major ok millert@
2008-11-09tweak previous;Jason McIntyre
2008-11-08Document the ddb.trigger sysctl.Chris Kuethe
feedback and ok mpf@, deraadt@
2008-10-24some SEE ALSO additions from Ingo Schwarze;Jason McIntyre
2008-10-22man page for Makefile.yp, and associated bits; from Ingo SchwarzeJason McIntyre
ok deraadt