aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* The <bsd.files.mk> API seems the best to use here.Ruslan Ermilov2004-01-201-11/+7
| | | | Notes: svn path=/head/; revision=124752
* 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
* Clean up makefiles.Ruslan Ermilov2004-01-196-23/+15
| | | | | | | Reviewed by: harti Notes: svn path=/head/; revision=124726
* 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
* Refactor _pthread_mutex_initMike Makonnen2004-01-191-125/+64
| | | | | | | | | | | | | | | o Simplify the logic by removing a lot of unnecesary nesting o Reduce the amount of local variables o Zero-out the allocated structure and get rid of all the unnecessary setting to 0 and NULL; Refactor _pthread_mutex_destroy o Simplify the logic by removing a lot of unnecesary nesting o No need to check pointer that the mutex attributes points to. Checking passed in pointer is enough. Notes: svn path=/head/; revision=124719
* Implement reference counting of read-write locks. This usesMike Makonnen2004-01-193-8/+155
| | | | | | | | | | | | | | | | | | | | a list in the thread structure to keep track of the locks and how many times they have been locked. This list is checked on every lock and unlock. The traversal through the list is O(n). Most applications don't hold so many locks at once that this will become a problem. However, if it does become a problem it might be a good idea to review this once libthr is off probation and in the optimization cycle. This fixes: o deadlock when a thread tries to recursively acquire a read lock when a writer is waiting on the lock. o a thread could previously successfully unlock a lock it did not own o deadlock when a thread tries to acquire a write lock on a lock it already owns for reading or writing [ this is admittedly not required by POSIX, but is nice to have ] Notes: svn path=/head/; revision=124718
* 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
* Deal better with the crypto version of the PAM library that goesRuslan Ermilov2004-01-185-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | on the release media -- only put what is different in the crypto version compared to the base version. This reduces PAM entries in /usr/lib in the "crypto" distribution to: libpam.a libpam.so@ libpam.so.2 pam_krb5.so@ pam_krb5.so.2 pam_ksu.so@ pam_ksu.so.2 pam_ssh.so@ pam_ssh.so.2 The libpam.so* is still redundant (it is identical to the "base" version), but we can't set DISTRIBUTION differently for libpam.a and libpam.so. (The removal of libpam.so* from the crypto distribution could be addressed by the release/scripts/crypto-make.sh script, but then we'd also need to remove redundant PAM headers, and I'm not sure this is worth a hassle.) Notes: svn path=/head/; revision=124675
* 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
* DISTRIBUTION is normally single-valued.Ruslan Ermilov2004-01-181-1/+1
| | | | Notes: svn path=/head/; revision=124665
* 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
* Mostly mechanical rework of libalias:Poul-Henning Kamp2004-01-1716-737/+1071
| | | | | | | | | | | | | | | Makes it possible to have multiple packet aliasing instances in a single process by moving all static and global variables into an instance structure called "struct libalias". Redefine a new API based on s/PacketAlias/LibAlias/g Add new "instance" argument to all functions in the new API. Implement old API in terms of the new API. Notes: svn path=/head/; revision=124621
* Remove crossref to pam.conf(5) which never existed.Jens Schweikhardt2004-01-171-1/+0
| | | | Notes: svn path=/head/; revision=124615
* 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
* Return EPERM if mutex owner is not current thread but it tries toDavid Xu2004-01-172-36/+6
| | | | | | | | | unlock the mutex, old code confuses some programs when it returns EINVAL. Noticed by: bland Notes: svn path=/head/; revision=124606
* 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 the fatal bug: CFLAGS should be added to, not overridden.Ruslan Ermilov2004-01-171-1/+1
| | | | | | | This prevented CPU and optimization flags to be added here. Notes: svn path=/head/; revision=124604
* Add an implementation of pthread_rwlock_timed{rd,wr}lock() to libthr withMike Makonnen2004-01-161-11/+54
| | | | | | | attendant documentation. Notes: svn path=/head/; revision=124586
* o We are not required to initialize an invalid rwlock. So axe all thatMike Makonnen2004-01-161-160/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | code and simply return EINVAL (which is allowed by the standard) in all those pthread functions that previously initialized it. o Refactor the pthread_rwlock_[try]rdlock() and pthread_rwlock_[try]wrlock() functions. They are now completeley condensed into rwlock_rdlock_common() and rwlock_wrlock_common(), respectively. o If the application tries to destroy an rwlock that is currently held by a thread return EBUSY where it previously went ahead and freed all resources associated with the lock. o Refactor _pthread_rwlock_init() to make it look (relatively) sane. o When obtaining a read lock on an rwlock the check for whether it would exceed the maximum allowed read locks should happen *before* we obtain the lock. o The pthread_rwlock_* functions shall *never* return EINTR, so make sure to requeue/resuspend the thread if it encounters such an error. o Make a note that pthread_rwlock_unlock() needs to ensure it holds a lock on an rwlock it tries to unlock. It will be implemented in a separate commit because it requires some additional rwlock infrastructure. Notes: svn path=/head/; revision=124583
* - Move the code to try to open a single chunk file and prompt for theJohn Baldwin2004-01-151-12/+31
| | | | | | | | | | associated floppy if needed into a static split_openfile() function. - Use this function in splitfs_open() to open the first chunk rather than using open() directly. This allows the first chunk to be located on a different disk than the actual foo.split file. Notes: svn path=/head/; revision=124572
* Whitespace tweaks to make indentation consistent within this file and evenJohn Baldwin2004-01-151-4/+4
| | | | | | | within a single function. Notes: svn path=/head/; revision=124571
* - Print out line number in a panic message using %d rather than %p. LineJohn Baldwin2004-01-152-2/+2
| | | | | | | | | numbers aren't pointers. - Add a __printflike() attribute to libstand's panic() prototype to catch such bogons in the future. Notes: svn path=/head/; revision=124570
* Fixed style of previous commit.Ruslan Ermilov2004-01-151-3/+2
| | | | | | | Submitted by: bde Notes: svn path=/head/; revision=124568
* Return ENOTSUP instead of -1.Ruslan Ermilov2004-01-151-1/+1
| | | | Notes: svn path=/head/; revision=124564
* Have a single set of POSIX threads man pages. The LIBRARY sectionRuslan Ermilov2004-01-14105-9661/+0
| | | | | | | | | | | of each manpage lists libraries that have corresponding interfaces implemented. Prodded by: threads Reviewed by: deischen Notes: svn path=/head/; revision=124535
* The libc_r/man/sigwait.3 manpage has been repocopied to libc/sys/sigwait.2.Ruslan Ermilov2004-01-144-94/+8
| | | | | | | | 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-1416-1028/+15
| | | | | | | | | | - 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
* bsd.dep.mk,v 1.43 allows us to replace a hack with a solution.Ruslan Ermilov2004-01-131-3/+3
| | | | Notes: svn path=/head/; revision=124491
* 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
* Removed duplicate SRCS.Ruslan Ermilov2004-01-111-1/+0
| | | | Notes: svn path=/head/; revision=124380
* 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
* Remove now redundant and now conflicting declaration of sysarch(2).Jacques Vidrine2004-01-101-3/+1
| | | | | | | | | Remove now unnecessary cast. Reported by: alpha tinderbox Notes: svn path=/head/; revision=124351
* 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
* Change sdp_open_local(3) API. It now takes a path to a control socketMaksim Yevmenkin2004-01-093-5/+14
| | | | | | | | | | | Teach sdpcontrol(8) how to talk to the local SDP server Update man pages s/u_int/uint Reviewed by: imp (mentor), ru Notes: svn path=/head/; revision=124317
* Prepare libsdp(3) for the upcoming sdpd importMaksim Yevmenkin2004-01-096-112/+190
| | | | | | | | | Also while i'm here s/u_int/uint Reviewed by: imp (mentor), ru Notes: svn path=/head/; revision=124305