summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Remove last remaining references to malloc/realloc and functions thatPeter Wemm1999-03-231-50/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | call them. All the execX() libc functions should be vfork() safe now. Specifically: - execlp() does the argument count-and-build into a vector from alloca (like the others) - buildargv() is no longer used (and gone). - execvp() uses alloca/strcpy rather than strdup(). - the ENOEXEC handler uses alloca rather than malloc. - a couple of free() calls removed - alloca works on the local stack and the allocations are freed on function exit (which is why buildargv wasn't useful - it's alloca() context would disappear on return). Along the way: - If alloca() fails (can it?), set errno = ENOMEM explicitly. - The ENOEXEC recovery routine that trys again with /bin/sh appeared to not be terminating the new argv[] array for /bin/sh, allowing it to walk off the end of the list. I dithered a bit about using alloca() even more as it's most commonly associated with gcc. However, standalone portable (using malloc) and machine-specific assembler alloca implementations appear to be available on just about all the architectures we're likely to want to port to. alloca will be the least of our problems if ever going to another compiler. Notes: svn path=/head/; revision=44974
* Add a sysctl variable which can help stop chroot(2) escapes.Poul-Henning Kamp1999-03-231-2/+29
| | | | | | | | | | | | | | | | | | kern.chroot_allow_open_directories = 0 chroot(2) fails if there are open directories. kern.chroot_allow_open_directories = 1 (default) chroot(2) fails if there are open directories and the process is subject of a previous chroot(2). kern.chroot_allow_open_directories = anything else filedescriptors are not checked. (old behaviour). I'm very interested in reports about software which breaks when running with the default setting. Notes: svn path=/head/; revision=44973
* Typo fix.Joseph Koshy1999-03-231-1/+1
| | | | | | | | PR: docs/10733 Submitted by: Steve Coltrin <spcoltri@io.com> Notes: svn path=/head/; revision=44961
* Don't be so selective about which errors cause us to continue andWarner Losh1999-03-211-7/+2
| | | | | | | | | | | which ones cause us to fail. Now all open errors on the databse file will cause the next file in the list to be tried. Submitted by: Arne Henrik Juul <arnej@math.ntnu.no> PR: 4585 Notes: svn path=/head/; revision=44921
* EACESS -> EACCESAlexander Langer1999-03-153-5/+5
| | | | Notes: svn path=/head/; revision=44761
* Add support for long long modifier (e.g. %llx, %lld).Doug Rabson1999-03-111-3/+9
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=44674
* PID_MAX is now 99999.Ollivier Robert1999-03-101-1/+1
| | | | | | | | PR: docs/10530 Submitted by: Ben Smithurst <ben@scientia.demon.co.uk> Notes: svn path=/head/; revision=44646
* Explain ENXIO error status with respect to fifos.Guy Helmer1999-03-071-0/+4
| | | | | | | PR: docs/8559 Notes: svn path=/head/; revision=44559
* Don't bogotify the synopsis by attempting to describe err_set_file() there.Bruce Evans1999-03-051-11/+19
| | | | | | | Fixed some disorder. Notes: svn path=/head/; revision=44485
* Fixed references to unmount(2) specified as umount.Alexander Langer1999-03-051-4/+4
| | | | | | | | Submitted by: Markus Friedl <markus.friedl@informatik.uni-erlangen.de> via OpenBSD Notes: svn path=/head/; revision=44484
* Fixed disordering and incoinsistent style in previous commit.Bruce Evans1999-03-051-3/+3
| | | | Notes: svn path=/head/; revision=44482
* The pseudocode in the synopsis didn't come close to actuallyBruce Evans1999-03-051-4/+6
| | | | | | | | | | | | compiling, since <stdio.h> correctly doesn't declare off_t although the pseudo-prototypes for the new fseeko() and ftello() functions use it. Handle this like the corresponding problem for va_list versus the vprintf() family. Fixed some English errors. Notes: svn path=/head/; revision=44481
* Don't use undocumented markup "{}". Use 32767 instead of LINK_MAX toBruce Evans1999-03-051-4/+3
| | | | | | | give bug for bug compatibility with intro.2. Notes: svn path=/head/; revision=44479
* Backed out most of rev.1.4. I didn't submit it; I only submitted aBruce Evans1999-03-051-7/+8
| | | | | | | | | | | | request for it something like it. It was poorly worded and too far from both POSIX wording and normal (mal)practice by referring to sysconf(_SC_NGROUPS_MAX) instead of {NGROUPS_MAX} or NGROUPS. POSIX.1 uses curly braces to mark up "symbolic constants or limits [that may be] defined in certain headers". Since we don't document this markup, don't use it. Just use NGROUPS_MAX. Notes: svn path=/head/; revision=44478
* Use sysctlbyname() instead of sysctl().Poul-Henning Kamp1999-03-051-6/+2
| | | | Notes: svn path=/head/; revision=44477
* Forgot to add $Id$ and change date in previous commit.Bruce Evans1999-03-051-1/+2
| | | | Notes: svn path=/head/; revision=44476
* Changed the type of quotactl()'s 4th arg from `char *' to `void *'Bruce Evans1999-03-051-1/+1
| | | | | | | | | | | | so that non-sloppy applications can call it without using disgusting casts to avoid warnings. The 4th arg is sort of varargs -- it must sometimes represent a filename, sometimes a struct pointer, and is sometimes unused. The arg type is still caddr_t in the kernel. Obtained from: mostly from NetBSD Notes: svn path=/head/; revision=44474
* These were missing from the previous commit.Warner Losh1999-03-0312-0/+12
| | | | Notes: svn path=/head/; revision=44441
* Bring in initial libc support for mips. These files were taken fromWarner Losh1999-03-0348-0/+2684
| | | | | | | | the OpenBSD tree and should be considered preliminary. They are here to facilitate building of the tree. Notes: svn path=/head/; revision=44440
* Correct synopsys: getsubopt is declared in unistd.h, not stdlib.h.Guy Helmer1999-03-021-1/+1
| | | | | | | PR: docs/9376 Notes: svn path=/head/; revision=44388
* Mention that getservbyport requires its port parameter to be inGuy Helmer1999-03-021-2/+3
| | | | | | | | | network byte order. PR: docs/9376 Notes: svn path=/head/; revision=44387
* Corrected use of backslash escaping in sample code.Guy Helmer1999-02-271-3/+3
| | | | | | | | PR: docs/10284 Submitted by: Alfred Perlstein <bright@cygnus.rush.net> Notes: svn path=/head/; revision=44306
* Decapitalize function name by prepending with word "The".Tim Vanderhoek1999-02-261-3/+6
| | | | | | | PR: docs/10247 Notes: svn path=/head/; revision=44286
* Fixed tab lossage in previous commit.Bruce Evans1999-02-251-2/+2
| | | | Notes: svn path=/head/; revision=44259
* remove ctype.c - unused and confusingAndrey A. Chernov1999-02-232-74/+2
| | | | Notes: svn path=/head/; revision=44236
* Add a note about ELF executables requiring to be linked with -export-dynamicJoseph Koshy1999-02-171-0/+8
| | | | | | | for dlsym() searches inside the executable to work. Notes: svn path=/head/; revision=44095
* EOPNOTSUPP also applies to fchflags().Bruce Evans1999-02-151-0/+3
| | | | Notes: svn path=/head/; revision=44065
* Mention that chflags can fail with EOPNOTSUPP.Dag-Erling Smørgrav1999-02-141-0/+2
| | | | Notes: svn path=/head/; revision=43995
* remove BUGS section, now behaviour is predictable enoughAndrey A. Chernov1999-02-131-2/+0
| | | | Notes: svn path=/head/; revision=43961
* more words about return valueAndrey A. Chernov1999-02-131-1/+5
| | | | Notes: svn path=/head/; revision=43947
* re-phrase things a bitAndrey A. Chernov1999-02-121-4/+5
| | | | Notes: svn path=/head/; revision=43946
* fix wrong return resultAndrey A. Chernov1999-02-122-23/+43
| | | | | | | | fix n=0 case improve manpage Notes: svn path=/head/; revision=43945
* fix tabs lost apparently in copy&pasteAndrey A. Chernov1999-02-121-5/+5
| | | | Notes: svn path=/head/; revision=43937
* Removed occurrences of consecutive repeated words (such as "the the").Alexander Langer1999-02-123-4/+3
| | | | Notes: svn path=/head/; revision=43920
* Added functions fseeko() and ftello() (from susv2).Dmitrij Tejblum1999-02-086-15/+83
| | | | | | | | | | Fixed fgetpos() and fsetpos() for offsets > 2GB. PR: 8637 Submitted by: Dan Nelson <dnelson@emsphone.com> (adjusted by me a little) Notes: svn path=/head/; revision=43782
* Document type for 'req' argument to clnt_control.Alexander Langer1999-01-311-0/+1
| | | | Notes: svn path=/head/; revision=43481
* Typo: `kern.somaxconn' -> `kern.ipc.somaxconn'Joseph Koshy1999-01-271-4/+4
| | | | | | | | PR: docs/9717 Submitted by: Nathan Dorfman <nathan@rtfm.net> Notes: svn path=/head/; revision=43271
* Clarify format of exit status code. Note when a return code of -1 canJoseph Koshy1999-01-271-4/+8
| | | | | | | | | | be expected. PR: docs/9701 Submitted by: Marc van Kempen <marc@bowtie.nl> Notes: svn path=/head/; revision=43265
* Mostly remove the VM_STACK OPTION.Julian Elischer1999-01-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the definitions of a few items so that structures are the same whether or not the option itself is enabled. This allows people to enable and disable the option without recompilng the world. As the author says: |I ran into a problem pulling out the VM_STACK option. I was aware of this |when I first did the work, but then forgot about it. The VM_STACK stuff |has some code changes in the i386 branch. There need to be corresponding |changes in the alpha branch before it can come out completely. what is done: | |1) Pull the VM_STACK option out of the header files it appears in. This |really shouldn't affect anything that executes with or without the rest |of the VM_STACK patches. The vm_map_entry will then always have one |extra element (avail_ssize). It just won't be used if the VM_STACK |option is not turned on. | |I've also pulled the option out of vm_map.c. This shouldn't harm anything, |since the routines that are enabled as a result are not called unless |the VM_STACK option is enabled elsewhere. | |2) Add what appears to be appropriate code the the alpha branch, still |protected behind the VM_STACK switch. I don't have an alpha machine, |so we would need to get some testers with alpha machines to try it out. | |Once there is some testing, we can consider making the change permanent |for both i386 and alpha. | [..] | |Once the alpha code is adequately tested, we can pull VM_STACK out |everywhere. | Submitted by: "Richard Seaman, Jr." <dick@tar.com> Notes: svn path=/head/; revision=43209
* Enable Linux threads support by default.Julian Elischer1999-01-261-0/+6
| | | | | | | | | | | | This takes the conditionals out of the code that has been tested by various people for a while. ps and friends (libkvm) will need a recompile as some proc structure changes are made. Submitted by: "Richard Seaman, Jr." <dick@tar.com> Notes: svn path=/head/; revision=43208
* gethostbyname2() was broken for lookups via NIS on FreeBSD/alphaAndrew Gallatin1999-01-251-4/+7
| | | | | | | | due to _gethostbynis() setting h.h_length to sizeof(u_long), which works out to 8 on alphas. And 8!= NS_INADDRSZ. Notes: svn path=/head/; revision=43171
* Backed out most of previous commit to go with backing out support forBruce Evans1999-01-241-4/+6
| | | | | | | revoke() on non-device files. Notes: svn path=/head/; revision=43143
* Merge from vendor branch: timezone file structure changes and doco.Garrett Wollman1999-01-213-25/+45
| | | | | | | | | Fix localtime.c to deal with new magic number field. Obtained from: ftp://elsie.nci.nih.gov/pub/tzcode1999a.tar.gz Notes: svn path=/head/; revision=42989
* Install man page link for strtok_r.John Polstra1999-01-191-1/+2
| | | | Notes: svn path=/head/; revision=42870
* Spell check and minor grammar fix.John Polstra1999-01-191-3/+3
| | | | Notes: svn path=/head/; revision=42869
* Document the errno return if the restrictions on the fcntl(F_SETOWN, ...)Don Lewis1999-01-191-0/+7
| | | | | | | | argument implemented by the security patch in PR kern/7899 are violated. PR: kern/7899 Notes: svn path=/head/; revision=42829
* revoke(2) is supported on regular files under current. Change wordingJoseph Koshy1999-01-181-6/+5
| | | | | | | | | | in manual page that indicated otherwise. PR: docs/9517 Submitted by: David Malone <dwmalone@maths.tcd.ie> Notes: svn path=/head/; revision=42781
* 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
* Make ctime_r, asctime_r, gmtime_r, and localtime_r available in libc.Dmitrij Tejblum1999-01-042-13/+4
| | | | Notes: svn path=/head/; revision=42293