summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Clean up a few things left dangling after the last commit. The newwpaul1995-12-151-22/+10
| | | | | | XDR routines auto-generated by rpcgen don't quite match the format of the original ones even though tey have the same names (that was one of the things wrong with the old XDR routines).
* Now that rpcgen is squared away, arrange to have all the NIS XDR routineswpaul1995-12-143-448/+93
| | | | | | | | | | | | | | | rpcgen-erated on the fly (just like librpcsvc). Makefile: Add rule for generating yp_xdr.c and yp.h. xdryp.c: gut everything except the special ypresp_all XDR function needed to to handle yp_all() (this one can't be created on the fly), and xdr_datum(), which isn't used internally by libc, but which as documented as being there in yp_prot.h, so what the hell. We now get everything else from yp_xdr.c. yplib.c: change a few structure member names to match those found in yp.h instead of those declared in yp_prot.h.
* Change phkmalloc so that the page directory is now floating and allocatedpeter1995-12-111-29/+47
| | | | | | | | | | | | | | | | | | | | | via mmap() up around the shared library area. Previously the directory was allocated from space from it's own memory pool. Because of the way it was being extended on processes with large malloced data segments (ie: inn) once the page directory was extended for some reason, it was not possible to lower the heap size any more to return pages to the OS. (If my understanding is correct, page directory expansion occurs at 4MB, 12MB, 20MB, 28MB, etc.) I was seeing INN allocate a large amount of short term memory, pushing it over the 28MB mark, and once it's transient demands hit 28MB, it never freed it's pages and swap space again.) I've been running this in my libc for about a month... Also, seperate MALLOC_STATS from EXTRA_SANITY.. I found it useful to call malloc_dump() from within INN from a ctlinnd command to see where the hell all the memory was going.. :-) I've left MALLOC_STATS enabled, as it has no run-time or data storage cost. Reviewed by: phk
* Fix minor annoyance: have clnt_perror(), clnt_perrno() andwpaul1995-12-101-4/+4
| | | | | clnt_pcreateerror() emit strings with newlines appended like other platforms do.
* Include sys/time.h, not sys/user.h.dg1995-12-081-1/+1
| | | | Submitted by: "Marc G. Fournier" <scrappy@hub.org>
* Fixed type mismatches.bde1995-12-074-12/+12
|
* Small tweak: don't try closing /etc/netgroup if we haven't opened it yet.wpaul1995-12-021-1/+2
|
* Restored [u]cmpdi2.c which are needed for switching on [unsigned] longbde1995-12-011-1/+1
| | | | long values.
* Removed cmpdi2.c from ${SRCS}. I think it is no more needed than ucmpdi2.bde1995-11-291-2/+1
| | | | Restored order in ${SRCS}.
* - Make _do_ypbind() check for /var/run/ypbind.lock and attempt to flock()wpaul1995-11-051-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | it before before trying to establish a binding. If /var/run/ypbind.lock doesn't exist, or if it exists and isn't locked, then ypbind isn't running, which means NIS is either turned off or hosed. - Have _yp_check() call yp_unbind() after it sucessfully calls yp_bind() to make sure it frees resources correctly. (I don't think there's really a memory leak here, but it seems somehow wrong to call yp_bind() without making a corresponding call to yp_unbind() afterwards.) This makes the NIS code behave a little better in cases where libc makes calls to NIS, but it isn't running correctly (i.e. there's no ypbind). This cleans up some strange libc behavior that manifests itself if you have the system domain name set, but aren't actually running NIS. In this event, the getrpcent(3) code could try to call into NIS and cause several inexplicable "clnttcp_create error: RPC program not registered" messages to appear. This happens because _yp_check() checks if the system domain name is set and, if it is, proceeds to call yp_bind() to attempt to establish a binding. Since there is no binding file (remember: ypbind isn't running, so /var/yp/binding will be empty), _yp_dobind() will attempt to contact ypbind to prod it into binding the domain. And because ypbind isn't running, the code generates the 'clnttcp_create' error. Ultimately the _yp_check() fails and the getrpcent(3) code rolls over to the /etc/rpc file, but the error messages are annoying, and the code should be smart enough to forgo the binding attempt when NIS is turned off.
* Add NIS support to getservent(3) functions (getservbyport() and getservbyname()wpaul1995-11-041-0/+68
| | | | | | | | both call getservent() to do most of the work, so we only need to modify this file to take care of everybody). Note that there is only one NIS services map (services.byname) even though there are getservbyname() and getservbyport() library functions.
* Document recent changes in socket buffers and listen(2).wollman1995-11-032-12/+38
|
* Move more stuff out to XPG4ache1995-11-034-0/+32
| | | | Handle negative chars inside runetype/tolower/toupper
* Add #include <sys/user.h>.phk1995-10-281-0/+1
|
* misc typosadam1995-10-273-7/+7
|
* Remove unneded ctype.hache1995-10-261-1/+0
|
* Fix it for chars with 8bit setache1995-10-231-1/+1
|
* Treat empty encoding as "C" encodingache1995-10-231-1/+1
|
* Optimize PathLocale handling.ache1995-10-231-7/+15
| | | | | Handle C/POSIX/"" properly. Don't reset collate to C when it is unnecessary
* Don't reset LC_TIME to C when it isn't neccessaryache1995-10-231-13/+17
|
* Use fake (empty) startup_setlocale for XPG4ache1995-10-231-3/+3
|
* Reduce static binaries bloat by splitting out normally unusedache1995-10-233-8/+45
| | | | setinvalidrune()
* Migrate from XPG4 to XPG3 (libxpg4 will be added soon)ache1995-10-239-56/+444
| | | | | Remove big part of my startup_setlocale hack. Add missing manpage links.
* Fixed lint from cc -Wall.bde1995-10-221-5/+6
| | | | Cleaned up includes.
* minor cleanup, #includes.phk1995-10-225-6/+11
|
* Mino cleanup, #includes & unused vars.phk1995-10-222-2/+6
|
* Minor cleanup, #include's and unused vars.phk1995-10-223-1/+5
| | | | Added compile-time warning to an old funky function.
* Well, cvs commit core'ed on me, I belive I have got all the locks out,phk1995-10-2223-32/+64
| | | | | | | | | | | | | | | | | | | but a commit mail got lost, it's the same as for this commit: lib/libc/gen confstr.c crypt.c disklabel.c fstab.c getcap.c getgrent.c getgrouplist.c getpass.c getpwent.c initgroups.c nlist.c psignal.c pwcache.c setmode.c sleep.c sysconf.c sysctl.c syslog.c usleep.c lib/libc/locale none.c read_runemagi.c setlocale.c lib/libc/net gethostbydns.c getnetbydns.c getnetbynis.c lib/libc/nls msgcat.c lib/libc/quad Makefile.inc lib/libc/regex engine.c regcomp.c regerror.c Minor cleanup, mostly unused vars and missing #includes. Limit the number of quad functions we pull in for 'i386'. I still belive the quad stuff should go back into gcc. Add compile-time warnings about crypt functions.
* Remove EXTRA_SANITY, fix a unused var.phk1995-10-221-4/+8
|
* More cleanup.phk1995-10-223-4/+1
| | | | Uhm, I also forgot: I took "EXTRA_SANITY" out of malloc.c
* limit the number of functions we pull in for 'i386'.phk1995-10-221-1/+11
| | | | I still belive this stuff should go back into gcc.
* and so on...phk1995-10-221-5/+3
|
* As above.phk1995-10-223-5/+7
|
* As above.phk1995-10-223-3/+2
| | | | Oh I also put in a couple of compile-time warnings for the crypt stuff.
* Minor cleanup, mostly unused vars and missing #includes.phk1995-10-2219-43/+46
|
* Add $Id$ since this version of the file has diverged from the BSD base apeter1995-10-211-1/+5
| | | | fair bit. I forgot to add it when I made the fixes some time ago.
* Propogate default table to restricted 8859-1 templateache1995-10-191-0/+32
| | | | | (only control/graph/punct/print tags used) Based on: kaleb@x.org and Bruce suggestions
* Remove the bugs section. sh(1) now has a ulimit builtin.joerg1995-10-191-9/+0
|
* Doubled the performance of getenv()/__findenv() by rewriting it to notdg1995-10-171-20/+24
| | | | use strncmp()..
* Add moncontrol.3 -> monstartup.3 link here.phk1995-10-151-0/+1
|
* Another tweak/speedup pass:wpaul1995-10-111-62/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix buffer overflow problem once and for all: do away with the buffer copies to 'user' prior to calling _scancaches() and just pass a pointer to the buffer returned by yp_match()/yp_first()/yp_next()/whatever. (We turn the first ':' to a NUL first so strcmp() works, then change it back later. Submitted by Bill Fenner <fenner@parc.xerox.com> and tweaked slightly by me. - Give _pw_breakout_yp() the 'more elegant solution' I promised way back when. Eliminate several copies to static buffers and replace them with just one copy. (The buffer returned by the NIS functions is at most YPMAXRECORD bytes long, so we should only need one static buffer of the same length (plus 2 for paranoia's sake).) - Also in _pw_breakout_yp(): always set pw.pw_passwd to the username obtained via NIS regardless of what pw_fields says: usernames cannot be overridden so we have no choice but to use the name returned by NIS. - _Again_ in _pw_breakout_yp(): before doing anything else, check that the first character of the NIS-returned buffer is not a '+' or '-'. If it is, drop the entry. (#define EXTRA_PARANOIA 1 :) - Probe for the master.passwd.* maps once during __initdb() instead of doing it each time _getyppass() or _nextyppass() is called. - Don't copy the NIS data buffers to static memory in _getyppass() and _nextyppass(): this is done in _pw_breakout_yp() now. - Test against phkmalloc and phkmalloc/2 (TNG!) to make sure we're free()ing the yp buffers sanely. - Put _havemaster(), _getyppass() and nextyppass() prototypes under #ifdef YP. (Somehow they ended up on the wrong side of the #endif.) - Remove unused variable ___yp_only.
* phkmalloc/2phk1995-10-082-311/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "zero' and 'junk' options to help find and diagnose malloc abuse. EXTRA_SANITY defaults "junk" to on. Don't dump the internal state, unless EXTRA_SANITY. General code cleanup. Error messages cleaned up a bit, more checking earlier. EXTRA_SANITY is default at this time (just in case). Performance (without EXTRA_SANITY) is better, beats gnumalloc in both time & space most of the time: # In-memory test. ./malloc 50000000 2000 8192 159.2u 1.5s 2:41.85 99.3% 5+7742k 0+0io 0pf+0w ./gnumalloc 50000000 2000 8192 272.6u 0.4s 4:35.01 99.3% 5+8533k 0+0io 0pf+0w # Swap-space test. ./malloc 500000 14000 8192 6.5u 4.1s 4:08.87 4.3% 5+49209k 0+0io 9772pf+0w ./gnumalloc 500000 14000 8192 16.2u 14.5s 15:36.14 3.2% 5+54100k 0+0io 47651pf+0w # Small items test. ./malloc 20000000 20000 2048 67.0u 0.3s 1:07.83 99.2% 5+18199k 0+0io 4pf+0w ./gnumalloc 20000000 20000 2048 66.2u 0.3s 1:07.03 99.3% 5+18107k 0+0io 0pf+0w SANITY is not an option anymore. (!!)
* Some NIS bug stomping:wpaul1995-10-061-24/+41
| | | | | | | | | | | | | | | | | | | | | | - In some cases, we don't properly resolve _all_ possible group memberships. If a user is a member of both local and NIS groups, we sometimes lose some of the membership info from NIS. (Reported by: Thorsten Kukuk <kukuk@uni-paderborn.de>) - Make NIS +groupname overrides actually work the way the SunOS group(5) man page says they should (make them work for all cases: getgrent(), getgrnam() and getgrgid()). - When not compiled with -DYP, grscan() should ignore entries that begin with a '+'. When compiled _with_ -DYP, grscan() should ignore +groupname entries that don't refer to real NIS groups. - Remove redundant redeclaration of fgets(), strsep() and index() inside grscan(). We already #include all the right header files for these. Note: -groupname exclusion as specified in the Sun documentation still isn't supported. This'll be a 2.2 addition. Right now I just want this stuff to work.
* remove GCC support functions from libc.phk1995-10-052-4/+2
| | | | Should never have been here in the first place.
* Fix the problem that I aroused with the last commit..peter1995-10-051-4/+10
| | | | | | | | | | | | | | | What was happening, is if syslogd was not running, syslog() would do a strcat("\r\n") on a non-null-terminated buffer, and write it to the console. This meant that sometimes extra characters could be written to the console during boot, depending on the stack contents. This totally avoids the potential problem by using writev() like the rest of the does, and avoid modifying the buffer after the trouble we've gone to to carefully protect it. This is actually a trivial fix, in spite of the long commit message.. :-) It only appeared during boot and shutdown with syslogd stopped.
* Make a link-time warning for the use of gets().peter1995-10-041-0/+3
| | | | | | | IMHO, the run-time warning should come out, but I'm not game to start that fight yet... This uses a feature of the gnu linker. Inspired by: NetBSD
* Calling sbrk(2) with zero argument doesn't need to generate a syscall.phk1995-10-042-8/+20
| | | | Reviewed by: bde
* Add man pages for the SYSV shm* and sem* functions.joerg1995-10-037-1/+890
| | | | | | | This partially closes PR # docs/177. This should probably also go into 2.1. Submitted by: daveho@infocom.com (David Hovemeyer)
* This gets() used \r\n, which is doggish.bde1995-09-291-1/+1
|
* Make ttyname() use posix-style tcgetattr() to check to see that it'speter1995-09-221-3/+3
| | | | | | running on a tty. (Same as isatty()) The old-style TIOCGETP ioctl wouldn't fly if the kernel didn't have COMPAT_43. Submitted by: Carl Fongheiser <cmf@netins.net>
OpenPOWER on IntegriCloud