summaryrefslogtreecommitdiff
path: root/lib/libc/gen
Commit message (Collapse)AuthorAgeFilesLines
* Use the correct type for uid and gid in struct passwd. Document it.Dag-Erling Smørgrav1999-01-181-2/+2
| | | | Notes: svn path=/head/; revision=42780
* Make the implementation and documentation agree. Specifically:Dag-Erling Smørgrav1999-01-062-6/+11
| | | | | | | | | | - document that sysctl() and sysctlbyname() return 0 on success - if the provided buffer is too small, set errno to ENOMEM and return -1 instead of returning ENOMEM. Notes: svn path=/head/; revision=42353
* Ignore the fs_spec entry for "/" in /etc/fstab if the device whichBruce Evans1999-01-011-0/+29
| | | | | | | | | | | is actually mounted on "/" can be determined using statfs() and is in /dev. This fixes fsck operating on the wrong device when the fs_spec entry is only an alias. The aliased case became more dangerous when the ROOTSLICE_HUNT hack was committed in mount(8). ROOTSLICE_HUNT may be unnecessary now. Notes: svn path=/head/; revision=42232
* Restore old semantics (broken in rev 1.47's buffer overflow fix).Eivind Eklund1998-12-171-1/+3
| | | | Notes: svn path=/head/; revision=41898
* Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This isBruce Evans1998-12-161-8/+7
| | | | | | | | | | | an unimprovement here. I thought it would be an improvement, as in libkvm, but here we can access the strings directly. Use sysctlbyname() instead of sysctl() and trust it to give a nonzero address if it succeeds. Notes: svn path=/head/; revision=41875
* Add reminder to return memory allocated by this call.Warner Losh1998-12-161-1/+10
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=41841
* PR: docs/9050Matthew Dillon1998-12-131-0/+1
| | | | | | | | Add reference to required include file #include <stdlib.h> for getloadavg(3) function call. Notes: svn path=/head/; revision=41714
* Removed unused include of <kvm.h>. It was alarming for libc to apparentlyBruce Evans1998-12-071-3/+1
| | | | | | | | | depend on libkvm. Removed obsolete `#define _NEW_VFSCONF'. Notes: svn path=/head/; revision=41581
* Fix a .Nm -> .Fn fix that was missed in the previous commit.Joseph Koshy1998-11-091-1/+1
| | | | | | | Pointed-out-by: Bruce Evans Notes: svn path=/head/; revision=41025
* Update manual page to reflect changes in rev 1.12 ofJoseph Koshy1998-11-061-3/+6
| | | | | | | | "src/lib/libc/gen/popen.c" --- popen() in the child now closes any copies of popen()'ed descriptors in the parent. Notes: svn path=/head/; revision=40952
* 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
* 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
* 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 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
* 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
* `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
* 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
* 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-169-19/+19
| | | | | | | | | | | | | | 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
* 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
* 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
* Document a number of VM sysctl variables with help from old emailsGuy Helmer1998-09-091-1/+38
| | | | | | | written by John Dyson. Notes: svn path=/head/; revision=39022
* Add a new library function getobjformat(). It checks all theJohn Polstra1998-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. Notes: svn path=/head/; revision=38960
* restore rev 1.23 to give clear SIGALRM handling example, 68 yearsAndrey A. Chernov1998-09-081-28/+16
| | | | | | | are too long to affect real code Notes: svn path=/head/; revision=38938
* Reviewed by: Andrey A. Chernov <ache@nagual.pp.ru>, Doug Rabson ↵Matthew 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. Notes: svn path=/head/; revision=38878
* Use INT_MAX instead of LONG_MAX since the variable being comparedJohn Birrell1998-09-051-4/+4
| | | | | | | is an int, not a long. Notes: svn path=/head/; revision=38847
* Sort cross references.Wolfram Schneider1998-08-311-3/+3
| | | | Notes: svn path=/head/; revision=38702
* Update to use the new elf headers.Doug Rabson1998-08-171-15/+28
| | | | Notes: svn path=/head/; revision=38391
* isnetworktty -> isnettty. ttyent.h has already gone through 3Bruce Evans1998-08-032-6/+6
| | | | | | | | | revisions to match the confusing spelling in getttyent.c (1 to break it to match the man page and 1 in each of 2 branches to fix it). This function seems to be orphaned and unused. Notes: svn path=/head/; revision=38054
* Fixed printf format errors.Bruce Evans1998-08-021-1/+1
| | | | Notes: svn path=/head/; revision=38020
* Add lockf().Dmitrij Tejblum1998-07-081-3/+3
| | | | Notes: svn path=/head/; revision=37515
* Make this look more FreeBSDish.Dmitrij Tejblum1998-07-081-8/+2
| | | | Notes: svn path=/head/; revision=37513
* This commit was generated by cvs2svn to compensate for changes in r37510,Dmitrij Tejblum1998-07-082-0/+345
|\ | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=37511
| * An implementation of lockf() function call.Dmitrij Tejblum1998-07-082-0/+345
| | | | | | | Obtained from: NetBSD (author: Klaus Klein) Notes: svn path=/vendor/NetBSD/dist/; revision=37510
* fts_close calls free(sp), the ISSET(FTS_NOCHDIR) which is a macro thatPoul-Henning Kamp1998-07-032-6/+8
| | | | | | | | | | | references sp. The free needs to follow ISSET PR: 7148 Reviewed by: phk Submitted by: Ken Mayer <kmayer@freegate.com> Notes: svn path=/head/; revision=37349
* Cross-reference to sysconf(3).Eivind Eklund1998-06-301-1/+2
| | | | Notes: svn path=/head/; revision=37319
* Fixed printf format errors.Bruce Evans1998-06-301-1/+1
| | | | Notes: svn path=/head/; revision=37301
* Make nlist() understand elf unconditionallyPeter Wemm1998-06-122-5/+2
| | | | Notes: svn path=/head/; revision=36919