summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
Commit message (Collapse)AuthorAgeFilesLines
* In example use of err(3) and errx(3), use sysexits(3) constants.rwatson2008-10-311-4/+5
| | | | | MFC after: 3 days Submitted by: Bruce Cran <bruce at cran dot org dot uk>
* 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
* 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.
* <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
* 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)
* 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
* 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
* 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.
* 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 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.
* 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
* In arc4random_uniform() detect simple "power of two" case andache2008-07-221-1/+5
| | | | return just (arc4random() % upper_bound)
* Add arc4random_uniform() function (to avoid "modulo bias")ache2008-07-224-1/+58
| | | | Obtained from: OpenBSD
* Increase initially dropped bytes from 512 to 768 (768 is alsoache2008-07-221-3/+3
| | | | | | | | suggested in the Ilya Mironov's article). 768 taken from another research where it treats as default for RC4-drop(768): http://www.users.zetnet.co.uk/hopwood/crypto/scan/cs.html#RC4-drop Minor style tweak.
* Add feature_present(3) to the FBSD 1.1 symbol map.jhb2008-07-211-0/+1
|
* 1) Use __packed attr on rdat structure to make it exact 128 bytes.ache2008-07-211-10/+17
| | | | | | | | | | 2) Use gettimeofday() and getpid() only if reading from /dev/urandom fails or impossible. 3) Discard N bytes on very first initialization only (i.e. don't discard on re-stir). 4) Reduce N from 1024 to 512 as really suggested in the "(Not So) Random Shuffles of RC4" paper: http://research.microsoft.com/users/mironov/papers/rc4full.pdf
* 1) Update copyright notice.ache2008-07-211-43/+53
| | | | | | | | | 2) Eliminate "struct arc4_stream *as" arg since only single arg is possible. 3) Set rs.j = rs.i after arc4random key schedule to be more like arc4 stream cipher. Obtained from: OpenBSD
* Add arc4random_buf to FBSD_1.1 spaceache2008-07-211-0/+1
|
* Add arc4random_buf.3 to MLINKSache2008-07-211-1/+2
|
* Implement arc4random_buf() functionache2008-07-212-4/+28
| | | | Obtained from: OpenBSD
* Decrease arc4_count only when needed and with proper bytes amount.ache2008-07-211-1/+2
| | | | Obtained from: OpenBSD
* 1) Set stired flag after forced initialization.ache2008-07-211-1/+2
| | | | | | | 2) Increase arc4_count to the limit OpenBSD use. Submitted by: Thorsten Glaser <tg@mirbsd.de> (1) Obtained from: OpenBSD (2)
* Make it more clear what it means that SA_RESTART is set for signalsimon2008-07-171-3/+5
| | | | | | | handlers added with signal(3). Submitted by: gnn (slightly modified by me) MFC after: 1 week
* Gcc barfs in glob.c when run with -O3. To fix this make g_strchr() work onmtm2008-06-261-5/+5
| | | | | | | and return (const Char *) pointers instead of just (Char *) and get rid of all the type casting. PR: kern/124334
* Turn execvpe() into an internal libc routine.ed2008-06-235-19/+9
| | | | | | | | | | | | Adding exevpe() has caused some ports to break. Even though execvpe() is a useful routine, it does not conform to any standards. This patch is a little bit different from the patch sent to the mailing list. I forgot to remove execvpe from the Symbol.map (which does not seem to miscompile libc, though). Reviewed by: davidxu Approved by: philip
* Process spawn attributes in POSIX document order.davidxu2008-06-191-21/+22
|
* Style fix.davidxu2008-06-171-1/+2
|
* Change my email address to the one from the FreeBSD project.ed2008-06-171-1/+1
| | | | Approved by: philip (mentor, implicit), davidxu
* Add POSIX routines called posix_spawn() and posix_spawnp(), whichdavidxu2008-06-175-14/+532
| | | | | | | | | can be used as replacements for exec/fork in a lot of cases. This change also added execvpe() which allows environment variable PATH to be used for searching executable file, it is used for implementing posix_spawnp(). PR: standards/122051
* Do not read away the target directory entry when encountering deletedkib2008-05-053-8/+9
| | | | | | | | | | | | | files after a seekdir(). The seekdir shall set the position for the next readdir operation. When the _readdir_unlocked() encounters deleted entry, dd_loc is already advanced. Continuing the loop leads to premature read of the target entry. Submitted by: Marc Balmer <mbalmer at openbsd org> Obtained from: OpenBSD MFC after: 2 weeks
* o Add MIPS to the list of architectures with defined TLS_TCB_ALIGNgonzo2008-04-291-2/+2
| | | | | | o Stick with TLS Variant II for MIPS for the moment. Approved by: imp
* Implement fdopendir(3) by splitting __opendir2() into two parts, the upper partdelphij2008-04-164-6/+71
| | | | | | deals with the usual __opendir2() calls, and the rest part with an interface translator to expose fdopendir(3) functionality. Manual page was obtained from kib@'s work for *at(2) system calls.
* Style fixes to opendir.c:delphij2008-04-161-6/+3
| | | | | - Use /*- for copyright block; - ANSIfy.
* Implement POSIX function tcgetsid() which returns session id.davidxu2008-04-154-1/+84
| | | | PR: stand/107561
* Minor style(9) nit: move to using ANSI definition of functions.imp2008-04-031-19/+5
|
* Fix descriptions of "struct msqid_ds and "struct ipc_perm" to matchru2008-04-031-11/+11
| | | | harsh reality.
* Document modff() and modfl(). Technically, modff() and modfl()das2008-03-292-12/+23
| | | | | | live in libm, while modf() lives in libc due to historical mistakes. I'm claiming in the manpage that they all live in libm, since programmers should not rely on the mistake.
* Removed no longer existing CTL_MACHDEP defines.ru2008-03-261-12/+1
| | | | Inspired by: phk
* Add the new kernel-mode NFS Lock Manager. To use it instead of thedfr2008-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | user-mode lock manager, build a kernel with the NFSLOCKD option and add '-k' to 'rpc_lockd_flags' in rc.conf. Highlights include: * Thread-safe kernel RPC client - many threads can use the same RPC client handle safely with replies being de-multiplexed at the socket upcall (typically driven directly by the NIC interrupt) and handed off to whichever thread matches the reply. For UDP sockets, many RPC clients can share the same socket. This allows the use of a single privileged UDP port number to talk to an arbitrary number of remote hosts. * Single-threaded kernel RPC server. Adding support for multi-threaded server would be relatively straightforward and would follow approximately the Solaris KPI. A single thread should be sufficient for the NLM since it should rarely block in normal operation. * Kernel mode NLM server supporting cancel requests and granted callbacks. I've tested the NLM server reasonably extensively - it passes both my own tests and the NFS Connectathon locking tests running on Solaris, Mac OS X and Ubuntu Linux. * Userland NLM client supported. While the NLM server doesn't have support for the local NFS client's locking needs, it does have to field async replies and granted callbacks from remote NLMs that the local client has contacted. We relay these replies to the userland rpc.lockd over a local domain RPC socket. * Robust deadlock detection for the local lock manager. In particular it will detect deadlocks caused by a lock request that covers more than one blocking request. As required by the NLM protocol, all deadlock detection happens synchronously - a user is guaranteed that if a lock request isn't rejected immediately, the lock will eventually be granted. The old system allowed for a 'deferred deadlock' condition where a blocked lock request could wake up and find that some other deadlock-causing lock owner had beaten them to the lock. * Since both local and remote locks are managed by the same kernel locking code, local and remote processes can safely use file locks for mutual exclusion. Local processes have no fairness advantage compared to remote processes when contending to lock a region that has just been unlocked - the local lock manager enforces a strict first-come first-served model for both local and remote lockers. Sponsored by: Isilon Systems PR: 95247 107555 115524 116679 MFC after: 2 weeks
* scandir(3) previously used st_size to obtain an initial estimatedas2008-03-161-13/+3
| | | | | | | | | | | | | of the array length needed to store all the directory entries. Although BSD has historically guaranteed that st_size is the size of the directory file, POSIX does not, and more to the point, some recent filesystems such as ZFS use st_size to mean something else. The fix is to not stat the directory at all, set the initial array size to 32 entries, and realloc it in powers of 2 if that proves insufficient. PR: 113668
* Remove trailing whitespace.ru2008-03-131-1/+1
|
* Add missing section number.ru2008-03-131-1/+1
|
* In file sem_timewait.3, remove reference to SYSV semphore in SEE ALSOdavidxu2008-03-132-4/+3
| | | | section, sync it with sem_wait.3.
* Add missing comma.davidxu2008-03-121-1/+1
|
* Add manual for function sem_timedwait().davidxu2008-03-122-1/+123
| | | | Reviewed by: ru, deischen
OpenPOWER on IntegriCloud