summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Updated manh shift constant type to 'ULL' for PPC to fixPeter Grehan2004-01-211-1/+1
| | | | | | | | | shift-too-large compile error reviewed by: das Notes: svn path=/head/; revision=124767
* 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
* Use 'uint32_t' instead of 'long' when a 32-bit integer is intended.David Schultz2004-01-201-31/+32
| | | | | | | | | | | | This results in no functional change, aside from fixing a data corruption bug on LP64 platforms. The code here could still use a significant amount of cleanup. PR: 56502 Submitted by: hrs (earlier version) Notes: svn path=/head/; revision=124738
* Simplify mpool_get() and mpool_write() by using pread() and pwrite()David Schultz2004-01-201-6/+3
| | | | | | | | | | instead of lseek()/_read() and lseek()/_write(). PR: bin/54276 Submitted by: <dnelson@allantgroup.com> Notes: svn path=/head/; revision=124735
* libc is now WARNS=2 clean with the exception of the gdtoa bits (whichJacques Vidrine2004-01-191-1/+1
| | | | | | | are now not built with warnings enabled at all). Notes: svn path=/head/; revision=124723
* Add prototypes for the three syscall stubs that are invoked here,Jacques Vidrine2004-01-191-0/+4
| | | | | | | in order to quiet warnings. Notes: svn path=/head/; revision=124722
* add cross-reference to clock_gettime(2)Poul-Henning Kamp2004-01-191-0/+1
| | | | Notes: svn path=/head/; revision=124712
* Bring the *printf(3) documentation up to date with the code:David Schultz2004-01-191-37/+24
| | | | | | | | | | | | | | | | | | | | | | - Update and improve the documentation for %[aA] o Like %[eE], %[aA] may round the result if a precision is specified. o Grammar police: Fix a split infinitive. o The FreeBSD implementation does better than the minimum required by C99 (literal translation of the mantissa). The digit before the hexadecimal-point is never 0 unless the number itself is 0. o Clarify that the exponent field represents a decimal exponent of 2. o Discuss the fact that multiple valid representations are possible. o Remove the entry in the BUGS section claiming that %[aA] is not implemented. - Remove the entry in the BUGS section claiming that the ' flag for printing thousands separators is unimplemented for floating-point. - Remove the entry in the BUGS section claiming that the L modifier reduces the precision to "double" before conversion. Notes: svn path=/head/; revision=124710
* 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
* Implement __hdtoa() and __hldtoa() and enable printf() support for %aDavid Schultz2004-01-183-6/+435
| | | | | | | and %A, which print floating-point numbers in hexadecimal. Notes: svn path=/head/; revision=124667
* Prototype __hdtoa() and __hldtoa().David Schultz2004-01-181-0/+2
| | | | Notes: svn path=/head/; revision=124658
* Fix some bugs affecting the %a and %A format specifiers. SinceDavid Schultz2004-01-181-6/+16
| | | | | | | | | | | | | | | | these are not fully implemented and ifdef'd out, the bugs have never manifested themselves. Specifically: - Fix a memory leak in the case where %a follows another floating-point format. - Make the %a/%A code behave like %e/%E with respect to precision. - It is no longer valid to assume that '-' and '0x' are mutually exclusive. - Address other minor issues. Notes: svn path=/head/; revision=124657
* Add a delta accidentally omitted from the previous commit:David Schultz2004-01-181-0/+3
| | | | | | | | Define DBL_MANH_SIZE and DBL_MANL_SIZE to be the sizes of the high and low words of the mantissa in bits, respectively. Notes: svn path=/head/; revision=124655
* Define LDBL_MANH_SIZE and LDBL_MANL_SIZE to be the sizes of theDavid Schultz2004-01-186-0/+18
| | | | | | | high and low words of the mantissa in bits, respectively. Notes: svn path=/head/; revision=124653
* Fix a bug that caused long double subnormals to be printedDavid Schultz2004-01-181-0/+3
| | | | | | | | incorrectly on architectures without an explicit normalization bit (sparc64, powerpc). Notes: svn path=/head/; revision=124652
* 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
* The libc_r/man/sigwait.3 manpage has been repocopied to libc/sys/sigwait.2.Ruslan Ermilov2004-01-142-6/+7
| | | | | | | | Reviewed by: deischen Repocopy by: markm Notes: svn path=/head/; revision=124533
* - libc/sys/sem.c was repocopied to libc/gen/sem.c.Ruslan Ermilov2004-01-149-366/+14
| | | | | | | | | | - sem_*(3) manpages were repocopied from libc_r. Reviewed by: deischen Repocopy by: markm Notes: svn path=/head/; revision=124530
* Translate from GNU C to ISO C.Dag-Erling Smørgrav2004-01-144-4/+4
| | | | Notes: svn path=/head/; revision=124514
* Add and document ffsl(), fls() and flsl().Dag-Erling Smørgrav2004-01-137-12/+201
| | | | Notes: svn path=/head/; revision=124483
* 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
* XDR sources are handled by ../xdr/Makefile.inc.Ruslan Ermilov2004-01-111-4/+0
| | | | Notes: svn path=/head/; revision=124379
* Replaced an ugly hack to selectively disable warningsRuslan Ermilov2004-01-112-3/+3
| | | | | | | | | | in contributed sources with just a hack made possible by bsd.sys.mk,v 1.33. This is better because it just nulls out the warning flags rather than adding gcc(1) specific -w option to CFLAGS. Notes: svn path=/head/; revision=124374
* Add an ulgy hack so that warnings added by non-zero WARNS values won't beDavid E. O'Brien2004-01-101-0/+3
| | | | | | | | | used with the contrib/ gdtoa sources as they aren't WARNS-clean. Submitted by: ru Notes: svn path=/head/; revision=124354
* Clarify the behavior of ptrace(2) a little bit: the tracing processRobert Watson2004-01-101-0/+24
| | | | | | | | | | | | | | | | | | must first attach to the traced process. If the tracing process exits without detaching, the traced process will be killed rather than continued. For the duration of the tracing session, the traced process is reparented to the tracing process (with resulting expected behaviors). It is permissible to trace more than one other process at a time. When using waitpid() to monitor the behavior of the traced process, signals are intercepted: they may optionally then be forwarded using ptrace(). Signals are generated normally by and for the process, but also by the tracing facility (SIGTRAP). Product of: Suffering Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=124346
* We need to discard `const'ness explicitly when invoking sysarch.Jacques Vidrine2004-01-101-1/+1
| | | | | | | Reported by: sparc64 tinderbox via bde Notes: svn path=/head/; revision=124342
* Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'mJacques Vidrine2004-01-0914-39/+14
| | | | | | | | | | | | | at it, use the ANSI C generic pointer type for the second argument, thus matching the documentation. Remove the now extraneous (and now conflicting) function declarations in various libc sources. Remove now unnecessary casts. Reviewed by: bde Notes: svn path=/head/; revision=124296
* It was reported that when using nss_ldap, getgrent(3) would behaveJacques Vidrine2004-01-091-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrectly when encountering `large' groups (many members and/or many long member names). The reporter tracked this down to the glibc NSS module compatibility code (nss_compat.c): it would prematurely record that a NSS module was finished iterating through its database in some cases. Two aspects are corrected: 1. nss_compat.c recorded that a NSS module was finished iterating whenever the module reported something other than SUCCESS. The correct logic is to continue iteration when the module reports either SUCCESS or RETURN. The __nss_compat_getgrent_r and __nss_compat_getpwent_r routines are updated to reflect this. 2. An internal helper macro __nss_compat_result is used to map glibc NSS status codes to BSD NSS status codes (e.g. NSS_STATUS_SUCCESS -> NS_SUCCESS). It provided the obvious mapping. When a NSS routine is called with a too-small buffer, the convention in the BSD NSS code is to report RETURN. (This is used to implement reentrant APIs such as getpwnam_r(3).) However, the convention in glibc for this case is to set errno = ERANGE and overload TRYAGAIN. __nss_compat_result is updated to handle this case. PR: bin/60287 Reported by: Lachlan O'Dea <odela01@ca.com> Notes: svn path=/head/; revision=124289
* Adjust for brain outage that affected the previous commit.Jacques Vidrine2004-01-061-1/+1
| | | | | | | Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Notes: svn path=/head/; revision=124193
* Add required headers.Jacques Vidrine2004-01-062-0/+4
| | | | Notes: svn path=/head/; revision=124191
* Add required headers and function declarations.Jacques Vidrine2004-01-062-0/+3
| | | | Notes: svn path=/head/; revision=124190
* Remove unused variables. Add required headers and functionJacques Vidrine2004-01-067-6/+12
| | | | | | | declarations. Notes: svn path=/head/; revision=124182
* Use ANSI C function definition for `_mcount' and remove `static'Jacques Vidrine2004-01-061-2/+2
| | | | | | | | | prototype from header file. Discussed with: bde, maybe one year ago Notes: svn path=/head/; revision=124180
* Add missing declaration.Jacques Vidrine2004-01-061-0/+2
| | | | Notes: svn path=/head/; revision=124178
* Work around a `warning: zero-length printf format string'.Jacques Vidrine2004-01-061-1/+1
| | | | Notes: svn path=/head/; revision=124177
* Avoid undefined behavior:Jacques Vidrine2004-01-061-2/+2
| | | | | | | foo[i] = bar[++i]; /* Which operator [] will be evaluated first? */ Notes: svn path=/head/; revision=124176
* Make intentions explicit with additional parenthesis.Jacques Vidrine2004-01-062-8/+8
| | | | Notes: svn path=/head/; revision=124175
* Remove unused variables and function declarations. Add missing headers.Jacques Vidrine2004-01-065-8/+6
| | | | Notes: svn path=/head/; revision=124174
* Describe kern.ipc.nsfbufsused and kern.ipc.nsfbufspeak.Maxim Konovalov2003-12-291-0/+9
| | | | | | | Reviewed by: silby Notes: svn path=/head/; revision=123968
* 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
* Add restrict qualifiers. (docs)Alfred Perlstein2003-12-245-5/+5
| | | | | | | | PR: 44394 Submitted by: Craig Rodrigues <rodrige@attbi.com> Notes: svn path=/head/; revision=123814
* Properly advance "x/y/z" form slash-pointers in some rare casesAndrey A. Chernov2003-12-241-4/+4
| | | | | | | PR: 60539 Notes: svn path=/head/; revision=123801
* 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
* Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendorAlexander Kabaev2003-12-192-13/+2
| | | | | | | | | | | | | | | | ó++ ABI document at http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor The ABI was initially defined for ia64, but GCC3 and Intel compilers have adopted it on other platforms. This is the patch from PR bin/59552 with a number of changes by me. PR: bin/59552 Submitted by: Bradley T Hughes (bhughes at trolltech dot com) Notes: svn path=/head/; revision=123674
* Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendorAlexander Kabaev2003-12-191-7/+101
| | | | | | | | | | | | | | | | C++ ABI document at http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor The ABI was initially defined for ia64, but GCC3 and Intel compilers have adopted it on other platforms. This is the patch from PR bin/59552 with a number of changes by me. PR: bin/59552 Submitted by: Bradley T Hughes (bhughes at trolltech dot com) Notes: svn path=/head/; revision=123673
* First byte of GBK-like sequences is 0x81, not 0x80Andrey A. Chernov2003-12-191-1/+1
| | | | Notes: svn path=/head/; revision=123665