summaryrefslogtreecommitdiff
path: root/lib/libc/gen
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug that could result in getpw*() incorrectly returning NULL when NISJonathan Chen2004-04-211-0/+1
| | | | | | | | | | adjunct maps are used. One symtom of this bug is sshd saying: login_get_lastlog: Cannot find account for uid X when logging in. The problem here is caused by an incorrect reuse of the rv variable when previous values are needed later. Notes: svn path=/head/; revision=128537
* Belatedly remove the getvfsent(3) API. All the consumers have beenMaxime Henrion2004-04-113-342/+2
| | | | | | | | updated to use getvfsbyname(3) or the vfs.conflist sysctl since a long time, except mount_smbfs(8) which has just been fixed. Notes: svn path=/head/; revision=128143
* Terminate execl()'s argument list with a null pointer instead of aTim J. Robbins2004-04-091-1/+1
| | | | | | | | | | null pointer constant. (The latter may be an integer constant, which is not correct here.) Submitted by: Stefan Farfeleder Notes: svn path=/head/; revision=128050
* Document the existence of NET_RT_IFMALIST.Bruce M Simpson2004-03-251-0/+7
| | | | | | | Reviewed by: ru Notes: svn path=/head/; revision=127401
* [troff] removed the unnecessary use of \_ escapes.Ruslan Ermilov2004-03-251-96/+96
| | | | Notes: svn path=/head/; revision=127400
* Add locking so that arc4random(3) functions are all reentrant forBrian Feldman2004-03-241-10/+54
| | | | | | | | | pthreads. Submitted by: Christian S.J. Peron <maneo@bsdpro.com> Notes: svn path=/head/; revision=127373
* Document incorrect handling of multibyte characters.Tim J. Robbins2004-03-211-1/+7
| | | | Notes: svn path=/head/; revision=127271
* Document additional reasons that sysctl(3) can return ENOMEM (due toDon Lewis2004-03-151-0/+11
| | | | | | | vslock() failure). Notes: svn path=/head/; revision=127015
* Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)Mark Murray2004-03-052-2/+2
| | | | | | | | | | | | | | | | | | that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C). There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK. Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii <nul> ('\0') was needed, and a few were just "other". Tested on: i386 sparc64 Notes: svn path=/head/; revision=126643
* Apply style(9).Brian Feldman2004-02-231-2/+6
| | | | | | | | Submitted by: "Christian S.J. Peron" <maneo@bsdpro.com> PR: bin/63283 Notes: svn path=/head/; revision=126180
* Add signal numbers to signal(3).Josef El-Rayes2004-02-231-33/+36
| | | | | | | | | | Approved by: simon(mentor) Reviewed by: ru Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> PR: docs/60044 Notes: svn path=/head/; revision=126164
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-101-2/+0
| | | | | | | | | | | These files had tags at the start of the file (incorrect, removed), and after the copyright notices (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125667
* Prevent memory leak on sem_destroy() by destroying the semaphore'sDaniel Eischen2004-02-061-1/+4
| | | | | | | internal mutex and CV. Notes: svn path=/head/; revision=125521
* Only allow the semaphore to be taken when the value is positive.Daniel Eischen2004-02-061-2/+1
| | | | | | | | | Don't decrement it twice when it is taken. Reported by: kris Notes: svn path=/head/; revision=125518
* Correct check for invalid semaphore on sem_destroy() (s/==/!=/).Daniel Eischen2004-02-051-1/+1
| | | | | | | Reported by: kris Notes: svn path=/head/; revision=125509
* Correct the weak reference for sem_unlink.Daniel Eischen2004-02-051-1/+1
| | | | Notes: svn path=/head/; revision=125502
* Allow libc's version of sem_trywait() to work for non-pshared mutexes.Daniel Eischen2004-02-041-2/+17
| | | | Notes: svn path=/head/; revision=125446
* Modify the implementation of libc semaphores so that they can beDaniel Eischen2004-02-031-146/+132
| | | | | | | | | | | | | | | overridden by the threads library to provide a userland version of non-pshared semaphores and cancellation points. Also add a sem_timedwait(). The libc version of semaphores always uses kernel semaphores regardless of whether pshared is set or not. When threads are not present, it is difficult to get sem_wait() or sem_timedwait() to do the right thing (since pthread_cond_timedwait() and pthread_cond_wait() are stubs in libc and just return immediately). Notes: svn path=/head/; revision=125372
* Discard the first 1024 bytes of output as suggested byDavid Schultz2004-01-201-1/+13
| | | | | | | | | | | http://citeseer.nj.nec.com/fluhrer01weaknesses.html and http://citeseer.nj.nec.com/531224.html . PR: 61126 Submitted by: Jeff Ito <jeffi@rcn.com> Notes: svn path=/head/; revision=124741
* add missing endusershell() call. Original version was incorrect.Philippe Charnier2004-01-181-1/+3
| | | | | | | | PR: bin/2442 Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de> Notes: svn path=/head/; revision=124690
* Backout revision 1.6, because some stub functions not in libc, andDavid Xu2004-01-171-18/+2
| | | | | | | | non-threaded won't build. The cancellation point support should be further discussed. Notes: svn path=/head/; revision=124614
* Enable cancellation point in sem_wait, it is required by POSIX.David Xu2004-01-171-2/+18
| | | | | | | | | For pshared semaphore, this commit still does not enable cancellation point, I think there should be a pthread_enter_cancellation_point_np for libc to implement a safe cancellation point. Notes: svn path=/head/; revision=124605
* Fixed style of previous commit.Ruslan Ermilov2004-01-151-3/+2
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=124568
* - libc/sys/sem.c was repocopied to libc/gen/sem.c.Ruslan Ermilov2004-01-147-8/+13
| | | | | | | | | | - sem_*(3) manpages were repocopied from libc_r. Reviewed by: deischen Repocopy by: markm Notes: svn path=/head/; revision=124530
* Kill whitespace at end of lines.Jacques Vidrine2004-01-121-9/+9
| | | | Notes: svn path=/head/; revision=124432
* Fix a bug that could result in a null pointer dereference inJacques Vidrine2004-01-121-1/+1
| | | | | | | | | | | | | | getpwent(3) or getpwuid(3) when using NIS adjunct maps. The bug was present in the internal `nis_passwd' function. The lookup in the adjunct map used the name passed into `nis_passwd', however no name was of course supplied by getpwent or getpwuid. Correctly use the name from the `struct pwd' that was found instead. PR: bin/59962 Submitted by: Gabriel Gomez <ggomez@fing.edu.uy> Notes: svn path=/head/; revision=124431
* Remove unused variables and function declarations. Add missing headers.Jacques Vidrine2004-01-061-3/+0
| | | | Notes: svn path=/head/; revision=124174
* Make sure we initialise dirp->dd_size if we aren't reading a unionfsDoug Rabson2003-12-261-0/+1
| | | | | | | | | directory. Special thanks to: valgrind Notes: svn path=/head/; revision=123861
* Back out previous commit due to incorrect content.Tom Rhodes2003-12-231-128/+62
| | | | | | | Noticed by: wollman Notes: svn path=/head/; revision=123780
* Document many of the missing posix.1b options.Tom Rhodes2003-12-231-62/+128
| | | | | | | | | PR: 20528 Submitted by: bms (original version) Requested by: mike (awhile ago) Notes: svn path=/head/; revision=123773
* Fix problem where initgroups would silently truncate groups withDiomidis Spinellis2003-11-191-2/+7
| | | | | | | | | | more than NGROUP elements without providing the opportunity to setgroups to fail and correctly return error and set errno. MFC after: 2 weeks Notes: svn path=/head/; revision=122899
* Remove ',' accidentally added after ".Xr fork 2".Guy Helmer2003-11-101-1/+1
| | | | Notes: svn path=/head/; revision=122443
* Prevent abnormal termination of a child daemon process when createdGuy Helmer2003-11-102-3/+35
| | | | | | | | | | | | | by a parent that is a session leader (e.g., login shell) by ignoring SIGHUP in before calling fork(2) and then restoring SIGHUP's action after setsid(3). Based on the patch by Martin Kammerhofer <mkamm@gmx.net>. PR: bin/25462 Reviewed by: bde, alex.neyman@auriga.ru Notes: svn path=/head/; revision=122442
* Rephrase .Nd description to contain the keyTim Kientzle2003-11-061-1/+1
| | | | | | | | | | words "pattern" and "test"; this should make it easier to find with "man -k" Approved by: gordon (mentor) Notes: svn path=/head/; revision=122155
* Add '#' to the characters VIS_GLOB encodes. This fixes a bug in mtree.Poul-Henning Kamp2003-10-302-2/+3
| | | | Notes: svn path=/head/; revision=121737
* Add a new flag to vis(3): VIS_GLOB which encodes the glob(3) magicPoul-Henning Kamp2003-10-302-2/+7
| | | | | | | characters '*', '?' and '['. Notes: svn path=/head/; revision=121728
* Remove incomplete support for running FreeBSD userland on old NetBSD kernelsTim J. Robbins2003-10-294-14/+1
| | | | | | | lacking the issetugid() and utrace() syscalls. Notes: svn path=/head/; revision=121667
* mdoc(7): Fix common mistakes made in the SEE ALSO section.Ruslan Ermilov2003-09-121-1/+1
| | | | Notes: svn path=/head/; revision=120010
* mdoc(7): Properly mark C headers.Ruslan Ermilov2003-09-104-5/+5
| | | | Notes: svn path=/head/; revision=119964
* mdoc(7): Use the new feature of the .In macro.Ruslan Ermilov2003-09-0817-30/+30
| | | | Notes: svn path=/head/; revision=119893
* Update the kern.osreldate documentation to document the present formatEivind Eklund2003-09-011-2/+17
| | | | | | | | | used, and refer to <osreldate.h> to get userland date. Submitted by: ru Notes: svn path=/head/; revision=119654
* Add a kluge suggested by Marcel to paper over the difference betweenGarrett Wollman2003-08-191-0/+3
| | | | | | | | | | | | | | | gethostname()'s old and new signatures without requiring a library bump. Note that programs which called gethostname() with a negative argument were already broken, since the same type conversion was done by the old implementation. Add a note in the Makefile so that whoever next bumps the libc revision will delete the kluge at the same time (as it will no longer be necessary). This is only operative on 64-bit platforms. Submitted by: marcel Notes: svn path=/head/; revision=119151
* Change gethostname() to set errno to ENAMETOOLONG instead of ENOMEMGarrett Wollman2003-08-192-18/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | when the buffer is not long enough to hold the current host name. POSIX does not standardize error returns for gethostname(), so it doesn't matter which one we use, but ENAMETOOLONG is at least a little more intuitive, and mi suggests the existence of prior art. I've been running with this change for a while on my home machine with no effect. At the same time, I've updated the prototype for gethostname() to use the correct standard type (size_t) for the namelen argument. All of the in-tree callers fall into one of the following categories: 1) Call perror() or equivalent when gethostname() fails. 2) Ignore gethostname()'s return value entirely, potentially resulting in data corruption if the buffer is too small. 3) Fall back to a (possibly sensible) default value if gethostname() fails. Many of the callers I examined shows signs of confusion about the correct sizing of the host name buffer. gethostname(3) now has more information about this, as well as updated standards information. PR: 48114 Submitted by: mi (in part) Notes: svn path=/head/; revision=119140
* Add the POSIX 1003.1-2001 posix_madvise() interface.Bruce M Simpson2003-08-092-3/+4
| | | | | | | | | PR: standards/54634 Reviewed by: das Approved by: jake (mentor) Notes: svn path=/head/; revision=118684
* The upper end of the range of arc4random(3) is 2**32-1, not 2**31-1.David Schultz2003-07-311-2/+4
| | | | Notes: svn path=/head/; revision=118247
* Make raise and _raise as weak symbols, so they can be overriden byDavid Xu2003-07-191-1/+4
| | | | | | | | | thread library. Reviewed by: deischen Notes: svn path=/head/; revision=117757
* Rewrite to reflect slight change in semantics for C99, and note a bugGarrett Wollman2003-07-191-22/+39
| | | | | | | in the standard. Defer to gettimeofday(2) for error indications. Notes: svn path=/head/; revision=117754
* C99 compliance: time() always sets its return value in both placesGarrett Wollman2003-07-191-4/+7
| | | | | | | | | (if present), even on error. Pointed out by: Wojtek Lerch, on the Austin Group mailing-list Notes: svn path=/head/; revision=117753
* Revert to using yp_order() to probe for master.paswd.by* maps andBill Paul2003-07-181-7/+14
| | | | | | | | | | | | | | | | | | don't probe the server at all for passwd.by* maps. This fixes interoperability with the Services For UNIX NIS server (which is really a front end to Captive^WActiveDirectory). This server incorrectly returns success for all YPPROC_MASTER requests, even for maps that don't exist, which makes it impossible to (ab)use it to probe for the existence of the master.passwd.by* maps. This is a little kludgey, but basically restores the original behavior of getpwent.c as it is in -stable, and works around both the lack of YPPROC_ORDER on NIS+ servers as well as the broken YPPROC_MASTER on Services For UNIX servers. Notes: svn path=/head/; revision=117750
* Whitespace after keywords per style(9).Garrett Wollman2003-07-181-2/+2
| | | | Notes: svn path=/head/; revision=117735