summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Finish what revision 1.40 started. Revision 1.40 removed a false statementalc2008-10-241-8/+6
| | | | | | | from the description but not the errors section. This revision removes it from the errors statement. Add a statement about the non-portability of non-page-aligned offsets.
* Fix a typo.rdivacky2008-10-231-1/+1
| | | | Approved by: kib (mentor)
* Fix a typo. q is already a pointer.kib2008-10-221-1/+1
| | | | | Reported by: ache Pointy hat to: kib
* Remove doubtful structure definition with variable array members.kib2008-10-221-67/+75
| | | | | | | | | | | | I believe this is not a valid C99 construct. Use directly calculated offsets into the supplied buffer, using specified members length, to fill appropriate structure. Either use sysctl, or copy the value of the UNAME_x environment variable, instead of unconditionally doing sysctl, and then overriding a returned value with user-specified one. Noted and tested by: rdivacky
* - License change to a less restrictive one;delphij2008-10-191-33/+16
| | | | | | | | - ANSIfy; - Convert do {} while loop -> while {} for clarity; - Sync RCS ID with OpenBSD; Obtained from: OpenBSD
* Further simplify the code.delphij2008-10-191-11/+2
| | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de>
* Use strlcpy() in !localized case to avoid the -1's.delphij2008-10-171-2/+1
|
* MTC r183949:netchild2008-10-171-0/+5
| | | | | | | Allow to define MALLOC_PRODUCTION with a make variable instead of polluting the global CFLAGS. Reviewed by: jasone
* Let libstand(3) build on ARM.raj2008-10-141-0/+4
| | | | This is a pre-requisite for loader(8) + U-Boot support library on this arch.
* Add unistd.h to the getosreldate(3) manpage.kib2008-09-301-1/+2
| | | | | | Update referenced example to include unistd.h per manpage. Update example to be more style(9)-ish, silence warnings and add FreeBSD id to the source file.
* Support for CPU sets is going to appear in 7.1 before 8.0.jhb2008-09-292-2/+2
| | | | MFC after: 3 days
* Fix some ifdef logic in the libc syncicache() bit that I somehow missed in thenwhitehorn2008-09-241-1/+3
| | | | last commit. Now it really can use a runtime-set cacheline size.
* Allow the cacheline size on PowerPC to be set at runtime. This is essential fornwhitehorn2008-09-241-16/+16
| | | | | supporting 64-bit CPUs, which often have 128-byte cache lines instead of the standard 32.
* <osreldate.h> does not have a forward declration of getosreldate(), sorodrigc2008-09-201-1/+0
| | | | | | remove it from this man page. MFC after: 3 days
* Move uuid_enc_le, uuid_dec_le, uuid_enc_be and uuid_dec_be symbolsemax2008-09-191-0/+3
| | | | | | | into FBSD_1.1 section where they should be. Pointed out by: kib, deischen MFC after: 3 days
* Add uuid_enc,dec_le,be() functions to Symbol.mapemax2008-09-151-0/+4
| | | | | | Pointy hat goes to me. MFC after: 3 days
* Fix async mode (required for ypbind in manycast mode).dfr2008-09-151-2/+2
|
* Use PAGE_{SIZE,MASK,SHIFT} from machine/param.h rather than hard-codingjasone2008-09-101-120/+88
| | | | | | page size and using sysconf(3). Suggested by: marcel
* Initialise the SVCAUTH field for new transport structures when they aredfr2008-09-092-2/+3
| | | | | | | allocated instead of waiting for the first request. This fixes an issue with rpcbind's support for PMAPPROC_CALLIT. Reviewed by: markm
* Return two fixes from previous backout which does not requireache2008-09-091-1/+2
| | | | | | | | | | | | | | | | | review by secteam@ for the reasons mentioned below. 1) Rename /dev/urandom to /dev/random since urandom marked as XXX Deprecated alias in /sys/dev/random/randomdev.c (this is our naming convention and no review by secteam@ required) 2) Set rs_stired flag after forced initialization to prevent double stearing. (this is already in OpenBSD, i.e. they don't have double stearing. It means that this change matches their code path and no additional secteam@ review required) Submitted by: Thorsten Glaser <tg@mirbsd.de> (2)
* Unbreak ia64: pges are 8KB.marcel2008-09-061-1/+1
|
* Add two example regexps: (1) one for matching all the characterskeramida2008-09-051-0/+8
| | | | | | | | that belong in a character class, and (2) one for matching all the characters *not* in a character class. Submitted by: Mark B, mkbucc at gmail.com MFC after: 3 days
* Add thread-specific caching for small size classes, based on magazines.jasone2008-08-274-256/+1139
| | | | | | | | | | | | | | | | | | | | | | | | This caching allows for completely lock-free allocation/deallocation in the steady state, at the expense of likely increased memory use and fragmentation. Reduce the default number of arenas to 2*ncpus, since thread-specific caching typically reduces arena contention. Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced, cacheline-spaced, and subpage-spaced size classes. The advantages are: fewer size classes, reduced false cacheline sharing, and reduced internal fragmentation for allocations that are slightly over 512, 1024, etc. Increase RUN_MAX_SMALL, in order to limit fragmentation for the subpage-spaced size classes. Add a size-->bin lookup table for small sizes to simplify translating sizes to size classes. Include a hard-coded constant table that is used unless custom size class spacing is specified at run time. Add the ability to disable tiny size classes at compile time via MALLOC_TINY.
* Implement WNOWAIT flag for wait4(2). It specifies that process whose statuskib2008-08-261-2/+10
| | | | | | | | | is returned shall be kept in the waitable state. Add WSTOPPED as an alias for WUNTRACED. Submitted by: Jukka Ukkonen <jau at iki fi> PR: standards/116221 MFC after: 2 weeks
* When calculating arguments to the interpreter for the shebang scriptkib2008-08-261-1/+18
| | | | | | | | executed by fexecve(2), imgp->args->fname is NULL. Moreover, there is no way to recover the path to the script being executed. Do what some other U*ixes do unconditionally, namely supply /dev/fd/n as the script path when called from fexecve(). Document requirement of having fdescfs mounted as caveat.
* Remove grantpt.c, which should have been deleted in the MPSAFE TTY commit.ed2008-08-201-286/+0
| | | | | | The routines in grantpt.c have been moved to ptsname.c in the MPSAFE TTY layer, because grantpt() is now effectively a no-op. I forgot to remove the corresponding source file from libc.
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.ed2008-08-208-103/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last half year I've been working on a replacement TTY layer for the FreeBSD kernel. The new TTY layer was designed to improve the following: - Improved driver model: The old TTY layer has a driver model that is not abstract enough to make it friendly to use. A good example is the output path, where the device drivers directly access the output buffers. This means that an in-kernel PPP implementation must always convert network buffers into TTY buffers. If a PPP implementation would be built on top of the new TTY layer (still needs a hooks layer, though), it would allow the PPP implementation to directly hand the data to the TTY driver. - Improved hotplugging: With the old TTY layer, it isn't entirely safe to destroy TTY's from the system. This implementation has a two-step destructing design, where the driver first abandons the TTY. After all threads have left the TTY, the TTY layer calls a routine in the driver, which can be used to free resources (unit numbers, etc). The pts(4) driver also implements this feature, which means posix_openpt() will now return PTY's that are created on the fly. - Improved performance: One of the major improvements is the per-TTY mutex, which is expected to improve scalability when compared to the old Giant locking. Another change is the unbuffered copying to userspace, which is both used on TTY device nodes and PTY masters. Upgrading should be quite straightforward. Unlike previous versions, existing kernel configuration files do not need to be changed, except when they reference device drivers that are listed in UPDATING. Obtained from: //depot/projects/mpsafetty/... Approved by: philip (ex-mentor) Discussed: on the lists, at BSDCan, at the DevSummit Sponsored by: Snow B.V., the Netherlands dcons(4) fixed by: kan
* Import the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() andemax2008-08-143-2/+148
| | | | | | | | | uuid_dec_be() functions. These routines are not part of the DCE RPC API. They are provided for convenience. Reviewed by: marcel Obtained from: NetBSD MFC after: 1 week
* Move CPU_SPINWAIT into the innermost spin loop, in order to allow fasterjasone2008-08-141-2/+3
| | | | | | preemption while busy-waiting. Submitted by: Mike Schuster <schuster@adobe.com>
* Re-order the terms of an expression in arena_run_reg_dalloc() to correctlyjasone2008-08-141-2/+2
| | | | | | detect whether the integer division table is large enough to handle the divisor. Before this change, the last two table elements were never used, thus causing the slow path to be used for those divisors.
* Add prototype defination for setfib(2) to sys/socket.h.delphij2008-08-081-1/+2
|
* Remove variables which are assigned values and never used thereafter.cperciva2008-08-081-5/+1
| | | | | Found by: LLVM/Clang Static Checker Approved by: jasone
* Add an implementation of the RPCSEC_GSS authentication protocol for RPC. Thisdfr2008-08-0612-91/+360
| | | | | | | | is based on an old implementation from the University of Michigan with lots of changes and fixes by me and the addition of a Solaris-compatible API. Sponsored by: Isilon Systems Reviewed by: alfred
* Add EPERM to the ERRORS section.trhodes2008-08-041-1/+3
| | | | PR: 125746
* Initialize "nconv" to a reasonable value in all code paths. Prior tocperciva2008-08-041-1/+3
| | | | | | | this commit, sprintf("%s", "") could fail depending on what happened to be on the stack. Found by: LLVM/Clang Static Checker
* Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. Priorcperciva2008-08-041-0/+1
| | | | | | | | | to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown blocksize" as expected, but sometimes also "maximum blocksize is 1G" and "minimum blocksize is 512" depending on what happened to be on the stack. Found by: LLVM/Clang Static Checker
* Restructure and use different variables in the tests that involvescf2008-08-031-13/+15
| | | | | | | | | environ[0] to be more obvious that environ is not NULL before environ[0] is tested. Although I believe the previous code worked, this change improves code maintainability. Reviewed by: ache MFC after: 3 days
* Add EAGAIN to the ERRORS list, as found in kern_jail.c.trhodes2008-08-031-1/+3
| | | | | PR: 125253 Submitted by: Mateusz Guzik <mjguzik@gmail.com> (original version)
* Restored from previous backing out (because that is OpenBSD way, soache2008-08-031-12/+16
| | | | | | | | | assumed to be reviewd by them): Stir directly from the kernel PRNG, without taking less random pid & time bytes too (when it is possible). The difference with OpenBSD code is that they have KERN_ARND sysctl for that task, while we need to read /dev/random
* remove whitespace bug (8 spaces into one tab)remko2008-08-021-1/+1
| | | | Submitted by: ed
* Teach fmtcheck() about wint_t, intmax_t, char *, intmax_t *, anddas2008-08-022-37/+99
| | | | | | | | | wide string arguments. Also simplify the code that handles length modifiers and make it more conservative. For instance, be explicit about the modifiers allowed for %d, rather than assuming that anything other than L, q, t, or z implies an int argument.
* Detect if the application has cleared the environ variable by settingscf2008-08-021-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | the first value (environ[0]) to NULL. This is in addition to the current detection of environ being replaced, which includes being set to NULL. Without this fix, the environment is not truly wiped, but appears to be by getenv() until an *env() call is made to alter the enviroment. This change is necessary to support those applications that use this method for clearing environ such as Dovecot and Postfix. Applications such as Sendmail and the base system's env replace environ (already detected). While neither of these methods are defined by SUSv3, it is best to support them due to historic reasons and in lieu of a clean, defined method. Add extra units tests for clearing environ using four different methods: 1. Set environ to NULL pointer. 2. Set environ[0] to NULL pointer. 3. Set environ to calloc()'d NULL-terminated array. 4. Set environ to static NULL-terminated array. Noticed by: Timo Sirainen MFC after: 3 days
* Convert popen()'s `pidlist' to a SLIST, for consistency.ed2008-07-291-11/+13
| | | | | | | | | | | | | I guess the original author of the popen() code didn't want to use our <sys/queue.h> macro's, because the single linked list macro's didn't offer O(1) deletion. Because I introduced SLIST_REMOVE_NEXT() some time ago, we can now use the macro's here. By converting the code to an SLIST, it is more consistent with other parts of the C library and the operating system. Reviewed by: csjp Approved by: philip (mentor, implicit)
* Fix a few bugs with the _gettemp() routine which implements mkstemp(),jhb2008-07-281-11/+26
| | | | | | | | | | | | | | | mkstemps(), and mkdtemp(). - Add proper range checking for the 'slen' parameter passed to mkstemps(). - Try all possible permutations of a template if a collision is encountered. Previously, once a single template character reached 'z', it would not wrap around to '0' and keep going until it encountered the original starting letter. In the edge case that the randomly generated starting name used all 'z' characters, only that single name would be tried before giving up. PR: standards/66531 Submitted by: Jim Luther Obtained from: Apple MFC after: 1 week
* Fix the email address formats in some posix_spawn(3) manpages.ed2008-07-282-2/+2
| | | | | | | | It seems I made a small bug when writing some of the posix_spawn(3) manpages. Remove the redundant "Ed Schouten", which broke the AUTHORS section. Approved by: philip (mentor, implicit)
* Add manual pages for posix_spawn() functions.davidxu2008-07-2811-1/+1483
| | | | PR: standards/122051
* Per rwatson's request:ache2008-07-251-29/+17
| | | | | | | | | | | | "If you don't get a review within a day or two, I would firmly recommend backing out the changes" back out all my changes, i.e. not comes from merging from OpenBSD as unreviewed by secteam@ yet. (OpenBSD changes stays in assumption they are reviewd by OpenBSD) Yes, it means some old bugs returned, like not setted rs_stired = 1 in arc4random_stir(3) causing double stirring.
* Fix cut-n-paste-ojulian2008-07-251-1/+1
| | | | Submitted by: Kostik Belousov
* Fixes based on bde's feedback.ache2008-07-221-9/+9
| | | | | | | | | | 1) Unindent and sort variables. 2) Indent struct members. 3) Remove _packed, use guaranteed >128 bytes size and only first 128 bytes from the structure. 4) Reword comment. Obtained from: bde
* Change /dev/urandom to /dev/random since urandom marked asache2008-07-221-1/+1
| | | | | XXX Deprecated alias in /sys/dev/random/randomdev.c
OpenPOWER on IntegriCloud