summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* A feeble attempt at kld compatability. The mount_* programs assume thatPeter Wemm1998-11-031-1/+10
| | | | | | | | | | | | | | they cannot mount a filesystem that they cannot see in getvfsbyname(). Part 1 of this is a hack, make vfsisloadable() always return true - the ultimate decider of whether it's loadable or not is kldload() or mount(). Part 2 of this is to have vfsload() call kldload(2) and return success if it works. This means that we will use a viable kld module in preference to an LKM! Ultimately, the thing to do is remove the hacks to do a vfsload in all the mount_* commands and let the kernel do it by itself in mount(2). Notes: svn path=/head/; revision=40863
* Typo.Jean-Marc Zucconi1998-10-301-1/+1
| | | | Notes: svn path=/head/; revision=40773
* Prevent buffer overflow in getpwnam()Mike Smith1998-10-291-2/+2
| | | | | | | | PR: bin/8176 Submitted by: Archie Cobbs <archie@whistle.com> Notes: svn path=/head/; revision=40742
* Clarify processing of the string argument by psignal().Robert Nordier1998-10-291-1/+3
| | | | Notes: svn path=/head/; revision=40738
* (Whoops: make it better instead of worse this time). ClarifyRobert Nordier1998-10-291-1/+1
| | | | | | | processing of the string argument by perror(). Notes: svn path=/head/; revision=40735
* Clarify processing of the string argument by perror().Robert Nordier1998-10-291-8/+5
| | | | Notes: svn path=/head/; revision=40734
* Check for a zero-length as well as a NULL string argument.Robert Nordier1998-10-291-1/+1
| | | | Notes: svn path=/head/; revision=40731
* The man page implies that the string argument to psignal() may beRobert Nordier1998-10-291-4/+2
| | | | | | | | NULL, in line with perror(3). However, the code presently checks only for a zero-length string. Check for both. Notes: svn path=/head/; revision=40727
* Handle ELF symbols better. This fixes "vmstat -i" for the caseJohn Polstra1998-10-281-59/+77
| | | | | | | where "/var/db/kvm_kernel.db" doesn't exist. Notes: svn path=/head/; revision=40688
* (`'): and (`'); -> (`:') and (`;')Bill Fenner1998-10-261-2/+2
| | | | Notes: svn path=/head/; revision=40667
* Slight style police.David E. O'Brien1998-10-251-3/+13
| | | | | | | Add some content from objformat(1). Notes: svn path=/head/; revision=40641
* fix unsigned overflowAndrey A. Chernov1998-10-251-5/+7
| | | | | | | PR: 8437 Notes: svn path=/head/; revision=40635
* Fix types.Dima Ruban1998-10-211-19/+19
| | | | Notes: svn path=/head/; revision=40544
* Revert last change. mkstemp() wasn't to blame, it's nvi. However,Peter Wemm1998-10-201-21/+5
| | | | | | | mkstemp() is not behaving as documented. Notes: svn path=/head/; revision=40540
* Stop mk*temp() from being pathologically stupid in the face of a umask(0);Peter Wemm1998-10-201-5/+21
| | | | | | | | | | There are other ways to fix this than wrapping _gettemp(), but this was the most convenient. Discovered by: bde Notes: svn path=/head/; revision=40539
* Fix style issues in execl(), and make execle() vfork()-safe.Dag-Erling Smørgrav1998-10-151-13/+23
| | | | | | | | Reviewed by: bde Approved by: jkh Notes: svn path=/head/; revision=40396
* Conform to POSIX and close any copies of popen() descriptors inherited by aMike Smith1998-10-151-0/+4
| | | | | | | | | | popen()ed child. PR: misc/7810 Submitted by: Wayne Scott <wscott@ichips.intel.com> Notes: svn path=/head/; revision=40367
* Correct braino in previous commit. I get the pointy hat again.Dag-Erling Smørgrav1998-10-141-3/+4
| | | | Notes: svn path=/head/; revision=40357
* Make execl() vfork()-safe. This should fix potential bugs in rcp,Dag-Erling Smørgrav1998-10-141-8/+20
| | | | | | | | | | telnet and tip, and probably a few other apps. Reviewed by: bde Approved by: jkh Notes: svn path=/head/; revision=40356
* Avoid the need for calling functions that malloc after a vfork().Peter Wemm1998-10-111-2/+10
| | | | Notes: svn path=/head/; revision=40219
* vfork -> fork. The child calls execl() which calls malloc(), soBruce Evans1998-10-101-1/+1
| | | | | | | | | | | | vfork() can't be used. We could use alloca() in execl() so that it can be called between vfork() and execve(), but a "portable" popen() shouldn't depend on this. Calling execle() instead of execl() should be fairly safe, since execle() is supposed to be callable from signal handlers and signal handlers can't call malloc(). However, execle() is broken. Notes: svn path=/head/; revision=40191
* Remove the description of EBADF (that's an implementation detail if IEivind Eklund1998-10-101-11/+6
| | | | | | | | | | | ever saw one), and move the description of NULL behaviour out to a 'NOTES' section, with an extra note that programs should not rely up on it. Kinda-approve-by: bde (by not replying to the mail with the diff) Notes: svn path=/head/; revision=40178
* Fix a memory leakJulian Elischer1998-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! Notes: svn path=/head/; revision=40013
* 64bit portability fixes.Doug Rabson1998-10-051-11/+11
| | | | | | | Submitted by: Andrew Gallatin <gallatin@cs.duke.edu> Notes: svn path=/head/; revision=39979
* program written under FreeBSD -> programs written under FreeBSDEivind Eklund1998-10-031-2/+2
| | | | | | | Noticed by: Alex Nash <nash@mcs.net> Notes: svn path=/head/; revision=39923
* Delete the XXX comments that refer to spinlock recursion. The malloc/free/John Birrell1998-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. Notes: svn path=/head/; revision=39802
* `kern.maxproc' is not changeable from sysctl(8).Joseph Koshy1998-09-291-1/+1
| | | | | | | Reminded by: Bruce Evans <bde@zeta.org.au> Notes: svn path=/head/; revision=39750
* Document that we will core-dump on getting a NULL pointer.Eivind Eklund1998-09-281-0/+4
| | | | Notes: svn path=/head/; revision=39716
* Don't cast int pointers to long pointers when reading labels fromDoug Rabson1998-09-261-6/+9
| | | | | | | /etc/disktab. Notes: svn path=/head/; revision=39684
* Apply patch to properly sscanf(3) when there is whitespace in the formatDavid E. O'Brien1998-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 Notes: svn path=/head/; revision=39644
* Use 8k pagesize on alpha, not 4k.Doug Rabson1998-09-231-1/+5
| | | | Notes: svn path=/head/; revision=39606
* Back out part of previous commit (even though it's technically correct).Alexander Langer1998-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. Notes: svn path=/head/; revision=39501
* Correctly back out of free if a recursive call into malloc.c is detected.Alexander Langer1998-09-191-8/+7
| | | | | | | | | Set malloc_func *after* grabbing the thread lock. Noticed by: Simon Coggins <simon@oz.org> Notes: svn path=/head/; revision=39491
* Simplify implementation and eliminate a register preservation problem.Luoqi Chen1998-09-182-48/+20
| | | | | | | Reviewed by: Bruce Evans <bde@zeta.org.au> Notes: svn path=/head/; revision=39455
* s/yellow pages/NIS/Poul-Henning Kamp1998-09-171-3/+2
| | | | | | | | | PR: 7949 Reviewed by: phk Submitted by: Norihiro Kumagai <kuma@jp.freebsd.org> Notes: svn path=/head/; revision=39408
* Sort table and descriptions.Joseph Koshy1998-09-161-7/+7
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=39334
* Replace memory leaking instances of realloc with non-leaking reallocf.Warner Losh1998-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... Notes: svn path=/head/; revision=39327
* o Don't reference non-existant function freealloc.Warner Losh1998-09-161-4/+4
| | | | | | | | | o Properly order things Pointed out by: bde Notes: svn path=/head/; revision=39325
* Fix style problems noted by Bruce:Warner Losh1998-09-162-8/+35
| | | | | | | | | o No copyright on reallocf. o Order makefile list correctly. o indent reallocf properly. Notes: svn path=/head/; revision=39322
* Don't initialize NIS until it is really necessary. Now, in case of networkDmitrij Tejblum1998-09-151-55/+71
| | | | | | | | | or NIS server problems, local user can login without a pause. Also, -Wsomething cleanup. Notes: svn path=/head/; revision=39283
* Turn off replies to ICMP echo requests for broadcast and multicastJoseph Koshy1998-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> Notes: svn path=/head/; revision=39267
* Replace accidentally-deleted `x' which caused warnx() to misbehave.Garrett Wollman1998-09-151-2/+2
| | | | Notes: svn path=/head/; revision=39202
* Correct a typo that I noticed.Joseph Koshy1998-09-151-1/+1
| | | | Notes: svn path=/head/; revision=39201
* o use strncpy safelyWarner Losh1998-09-141-3/+8
| | | | | | | | | | o Only allow options and domain name to be set when we aren't running setuid. Obtained from: OpenBSD Notes: svn path=/head/; revision=39194
* Add reallocf to the library. This function is simliar to realloc, butWarner Losh1998-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 Notes: svn path=/head/; revision=39191
* Fix a cut 'n paste mistake.Luoqi Chen1998-09-132-8/+8
| | | | Notes: svn path=/head/; revision=39140
* In libc_r, rename vfork syscall to _thread_sys_vfork and make vfork an aliasDmitrij Tejblum1998-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. Notes: svn path=/head/; revision=39118
* Document the fact that shutdown(2) is expected to comply with Posix.1g,Garrett Wollman1998-09-121-3/+20
| | | | | | | when it happens. Notes: svn path=/head/; revision=39117
* Change return type of strptime from const char* to char*.Dmitrij Tejblum1998-09-122-5/+5
| | | | | | | const char* was wrong and nonstandard. Notes: svn path=/head/; revision=39113
* A small last-minute iitem for 3.0:Garrett 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. Notes: svn path=/head/; revision=39112