summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Fix a memory leakjulian1998-10-071-15/+25
| | | | | | | | | | | PR: 7923 Submitted by: Archie Cobbs <archie@whistle.com> The scandir() function returns -1 if it fails. In many cases when this happens, it does not free the memory that it allocated, resulting in a memory leak, or close the directory opened with opendir(). BAD DOG, BAD!
* 64bit portability fixes.dfr1998-10-051-11/+11
| | | | Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
* program written under FreeBSD -> programs written under FreeBSDeivind1998-10-031-2/+2
| | | | Noticed by: Alex Nash <nash@mcs.net>
* Delete the XXX comments that refer to spinlock recursion. The malloc/free/jb1998-09-301-15/+1
| | | | | | | | | realloc functions check for recursion within the malloc code itself. In a thread-safe library, the single spinlock ensures that no two threads go inside the protected code at the same time. The thread implementation is responsible for ensuring that the spinlock does in fact protect malloc. There was a window of opportunity in which this was not the case. I'll fix that with a commit RSN.
* `kern.maxproc' is not changeable from sysctl(8).jkoshy1998-09-291-1/+1
| | | | Reminded by: Bruce Evans <bde@zeta.org.au>
* Document that we will core-dump on getting a NULL pointer.eivind1998-09-281-0/+4
|
* Don't cast int pointers to long pointers when reading labels fromdfr1998-09-261-6/+9
| | | | /etc/disktab.
* Apply patch to properly sscanf(3) when there is whitespace in the formatobrien1998-09-251-7/+2
| | | | | | | | | | | | | string. From the submitted patch: Credit for patch: Chris Torek <torek@bsdi.com> Tod Miller <millert@openbsd.org> This makes us in line with SunOS 4.1.3_U1, Solaris 2.6, OpenBSD 2.3, HP-UX 10.20, Irix 5.3. The previous behavior was in line with Ultrix 4.4. PR: bin/7970 Submitted by: Niall Smart nialls@euristix.ie
* Use 8k pagesize on alpha, not 4k.dfr1998-09-231-1/+5
|
* Back out part of previous commit (even though it's technically correct).alex1998-09-201-1/+17
| | | | | | | | | | | Our spinlock implementation allows a particular thread to obtain a lock multiple times, but release the lock with a single unlock call. Since we're detecting recursion, we know the lock is already owned by the current thread in a previous call and must not be released in the current call. This is really far too dependent on this particular spinlock implementation, so I've added commented out calls to THREAD_UNLOCK in the appropriate places. We can activate this code when spinlock is taught to count each lock operation.
* Correctly back out of free if a recursive call into malloc.c is detected.alex1998-09-191-8/+7
| | | | | | Set malloc_func *after* grabbing the thread lock. Noticed by: Simon Coggins <simon@oz.org>
* Simplify implementation and eliminate a register preservation problem.luoqi1998-09-182-48/+20
| | | | Reviewed by: Bruce Evans <bde@zeta.org.au>
* s/yellow pages/NIS/phk1998-09-171-3/+2
| | | | | | PR: 7949 Reviewed by: phk Submitted by: Norihiro Kumagai <kuma@jp.freebsd.org>
* Sort table and descriptions.jkoshy1998-09-161-7/+7
| | | | Pointed out by: bde
* Replace memory leaking instances of realloc with non-leaking reallocf.imp1998-09-1622-46/+50
| | | | | | | | | | | In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is guaranteed to be the same thing. I've been running these on my system here w/o ill effects for some time. However, the CTM-express is at part 6 of 34 for the CAM changes, so I've not been able to do a build world with the CAM in the tree with these changes. Shouldn't impact anything, but...
* o Don't reference non-existant function freealloc.imp1998-09-161-4/+4
| | | | | | o Properly order things Pointed out by: bde
* Fix style problems noted by Bruce:imp1998-09-162-8/+35
| | | | | | o No copyright on reallocf. o Order makefile list correctly. o indent reallocf properly.
* Don't initialize NIS until it is really necessary. Now, in case of networkdt1998-09-151-55/+71
| | | | | | or NIS server problems, local user can login without a pause. Also, -Wsomething cleanup.
* Turn off replies to ICMP echo requests for broadcast and multicastjkoshy1998-09-151-2/+6
| | | | | | | | | | | | | addresses by default. Add a knob "icmp_bmcastecho" to "rc.network" to allow this behaviour to be controlled from "rc.conf". Document the controlling sysctl variable "net.inet.icmp.bmcastecho" in sysctl(3). Reviewed by: dg, jkh Reminded on -hackers by: Steinar Haug <sthaug@nethelp.no>
* Replace accidentally-deleted `x' which caused warnx() to misbehave.wollman1998-09-151-2/+2
|
* Correct a typo that I noticed.jkoshy1998-09-151-1/+1
|
* o use strncpy safelyimp1998-09-141-3/+8
| | | | | | | o Only allow options and domain name to be set when we aren't running setuid. Obtained from: OpenBSD
* Add reallocf to the library. This function is simliar to realloc, butimp1998-09-143-13/+42
| | | | | | | | | | | | | when it returns NULL to indicate failure, it will also free the memory that was passed to it, if that was non-null. This does not change the semantics of realloc. A second commit will be done to commit the conversion of those places in the code that can safely use this to avoid memory leaks when confronted with low memory situations. Beaten-to-death-but-finally-approved-in: -current
* Fix a cut 'n paste mistake.luoqi1998-09-132-8/+8
|
* In libc_r, rename vfork syscall to _thread_sys_vfork and make vfork an aliasdt1998-09-123-6/+14
| | | | | | | to fork. It is difficult to do real vfork in libc_r, since almost every operation with file descriptsor changes _thread_fd_table and friends. popen(3) works much better with this change.
* Document the fact that shutdown(2) is expected to comply with Posix.1g,wollman1998-09-121-3/+20
| | | | when it happens.
* Change return type of strptime from const char* to char*.dt1998-09-122-5/+5
| | | | const char* was wrong and nonstandard.
* A small last-minute iitem for 3.0:wollman1998-09-122-84/+124
| | | | | | | | | - Fix some style errors I made back in 1995. - Add a new flavor of the err(3) family, which takes an explicit errno argument rather than implicitly examining errno. This will make it easier to use these functions in conjunction with modern library interfaces that return an errno value explicitly.
* Use ellipsis in synopsis.jkoshy1998-09-121-2/+6
| | | | Requested by: bde
* $@ -> ${.TARGET}imp1998-09-111-2/+2
|
* Change obsolete $@ to ${.TARGET}.imp1998-09-111-1/+1
|
* Don't trust TMPDIR if we're setuid root. This is used only for theimp1998-09-111-2/+3
| | | | | | | | | | backing file for an anonymous (memory based) btree, and I don't think that any setuid programs actually use it, but it is better to be safe than sorry. This has been in my tree for a long time, maybe a year or more... Inspired by: Similar changes in OpenBSD, if memory serves (like nearly a year ago)
* Mention which system interface functions are signal-safe.brian1998-09-091-1/+103
| | | | Suggested on -current by: Terry Lambert <tlambert@primenet.com>
* Document a number of VM sysctl variables with help from old emailsghelmer1998-09-091-1/+38
| | | | written by John Dyson.
* Change i386 in a few paths to ${MACHINE} to support MACHINE=pc98.kato1998-09-091-5/+5
|
* Add $Id$, remove quoting for `...'.jkoshy1998-09-091-1/+3
| | | | Requested by: bde
* Add a new library function getobjformat(). It checks all thejdp1998-09-093-3/+238
| | | | | | | | | | | | | standard places ("/etc/objformat", ${OBJFORMAT}, argv) for an indication of the user's preferred object file format. This consolidates some code that was starting to be duplicated in more and more places. Use the new function in ldconfig. Note: I don't think that gcc should use getobjformat(), even though it could. The compiler should limit itself to functions that are widespread, to ease porting and cross-compilation.
* Add support for the RPC 64-bit integer type ``hyper''.obrien1998-09-081-1/+57
|
* restore rev 1.23 to give clear SIGALRM handling example, 68 yearsache1998-09-081-28/+16
| | | | are too long to affect real code
* Use ellipsis in the synopsis, and an appropriate explanation injkoshy1998-09-082-4/+12
| | | | | | the text of the manual page. Suggested by: bde
* Reviewed by: Andrey A. Chernov <ache@nagual.pp.ru>, Doug Rabson ↵dillon1998-09-061-17/+29
| | | | | | | <dfr@nlsystems.com> Rewrote sleep() to remove int/long typing assumptions between the argument to the function and the timespec structure.
* Use a varargs style prototype in the manual page, with accompanyingjkoshy1998-09-061-1/+14
| | | | explanation in the text.
* Use INT_MAX instead of LONG_MAX since the variable being comparedjb1998-09-051-4/+4
| | | | is an int, not a long.
* Change a test for NETBSD_SYSCALLS to __alpha__. We're not ready tojb1998-09-051-2/+2
| | | | do profiling on alpha yet.
* Change the profile data file name from gmon.out to progname.gmonjb1998-09-052-7/+14
| | | | where progname comes from __progname in crt0 or crt1.
* Implement the weak aliases for private entry points in the inet_*jdp1998-09-0220-90/+167
| | | | | | | | | | | and res_* modules in a way that works for ELF. I moved the aliases out of res_stubs.c and into the individual modules where the entry points are defined. Weak aliases don't work in ELF unless that is the case. (Actually, I'm surprised it worked for a.out.) This should fix the undefined "inet_addr" and related symbols in various applications that fail to include <arpa/inet.h> or <resolv.h> as they are supposed to do.
* Sort cross references.wosch1998-08-315-14/+14
|
* Typo fix.jkoshy1998-08-281-1/+1
|
* Describe what constitues an exceptional condition.steve1998-08-241-0/+2
| | | | | PR: 7666 Submitted by: Archie Cobbs <archie@whistle.com>
* Update to use the new elf headers.dfr1998-08-171-15/+28
|
OpenPOWER on IntegriCloud