summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Make getcwd(3) faster, simpler and more compliant using *at syscalls.jilles2009-10-131-45/+18
| | | | | It is no longer necessary to construct long paths consisting of repeated "../" which may be slow to process and may exceed PATH_MAX.
* Add C message catalogue entries for newer errnos: EBADMSG, EMULTIHOP,rwatson2009-10-131-0/+10
| | | | | | | ENOLINK, EPROTO, ENOTCAPABLE. Submitted by: Alan R. S. Bueno <alan.bsd at gmail.com> MFC after: 3 days (most)
* Make openat(2) a cancellation point.jilles2009-10-113-0/+4
| | | | | | | This is required by POSIX and matches open(2). Reviewed by: kib, jhb MFC after: 1 month
* In nanosleep(2), note that the calling thread is put to sleep, not thekib2009-10-111-1/+3
| | | | | whole process. Also explicitely name the parameter that specifies sleep interval.
* Document errno codes added in r144530.das2009-10-111-0/+8
|
* Add a new errno, ENOTCAPABLE, to be returned when a process requests anrwatson2009-10-072-0/+4
| | | | | | | | operation on a file descriptor that is not authorized by the descriptor's capability flags. MFC after: 1 month Sponsored by: Google
* Add basename_r(3) to complement basename(3). basename_r(3) which acceptsrwatson2009-10-064-13/+33
| | | | | | | | a caller-allocated buffer of at least MAXPATHLEN, rather than using a global buffer. MFC after: 1 month Sponsored by: Google
* fts_open() requires that the list passed as argument to contain at leastdelphij2009-10-052-2/+8
| | | | | | | | | one path. When the list is empty (contain only a NULL pointer), return EINVAL instead of pretending to succeed, which will cause a NULL pointer deference in a later fts_read() call. Noticed by: Christoph Mallon (via rdivacky@) MFC after: 2 weeks
* Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.edwin2009-10-051-0/+6
| | | | | | Also modify the "-k list" option to display only fields with a certain prefix. MFC after: 1 week
* Better glibc compatibility for getline/getdelim:das2009-10-041-2/+2
| | | | | | | | | | | | | | - Tolerate applications that pass a NULL pointer for the buffer and claim that the capacity of the buffer is nonzero. - If an application passes in a non-NULL buffer pointer and claims the buffer has zero capacity, we should free (well, realloc) it anyway. It could have been obtained from malloc(0), so failing to free it would be a small memory leak. MFC After: 2 weeks Reported by: naddy PR: ports/138320
* Correct the pthread stub prototype for pthread_mutexattr_settype to allow formarcus2009-10-011-1/+1
| | | | | | | | | the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: kib deischen (threads) MFC after: 3 days
* Add two new fcntls to enable/disable read-ahead:delphij2009-09-281-1/+17
| | | | | | | | | | | | | | | | | | | | - F_READAHEAD: specify the amount for sequential access. The amount is specified in bytes and is rounded up to nearest block size. - F_RDAHEAD: Darwin compatible version that use 128KB as the sequential access size. A third argument of zero disables the read-ahead behavior. Please note that the read-ahead amount is also constrainted by sysctl variable, vfs.read_max, which may need to be raised in order to better utilize this feature. Thanks Igor Sysoev for proposing the feature and submitting the original version, and kib@ for his valuable comments. Submitted by: Igor Sysoev <is rambler-co ru> Reviewed by: kib@ MFC after: 1 month
* - Add Galician NLS cataloggabor2009-09-272-0/+250
|
* Make malloc(3) superpage aware. Specifically, if getpagesizes(3) returnsalc2009-09-262-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | a large page size that is greater than malloc(3)'s default chunk size but less than or equal to 4 MB, then increase the chunk size to match the large page size. Most often, using a chunk size that is less than the large page size is not a problem. However, consider a long-running application that allocates and frees significant amounts of memory. In particular, it frees enough memory at times that some of that memory is munmap()ed. Up until the first munmap(), a 1MB chunk size is just fine; it's not a problem for the virtual memory system. Two adjacent 1MB chunks that are aligned on a 2MB boundary will be promoted automatically to a superpage even though they were allocated at different times. The trouble begins with the munmap(), releasing a 1MB chunk will trigger the demotion of the containing superpage, leaving behind a half-used 2MB reservation. Now comes the real problem. Unfortunately, when the application needs to allocate more memory, and it recycles the previously munmap()ed address range, the implementation of mmap() won't be able to reuse the reservation. Basically, the coalescing rules in the virtual memory system don't allow this new range to combine with its neighbor. The effect being that superpage promotion will not reoccur for this range of addresses until both 1MB chunks are freed at some point in the future. Reviewed by: jasone MFC after: 3 weeks
* Correct a section name; specifically, "AUTHOR" should be "AUTHORS". [1]alc2009-09-211-3/+4
| | | | | | Turn the "AUTHORS" section into a full sentence. Pointed out by: ru [1]
* Add getpagesizes(3). This functions either the number of supported pagealc2009-09-194-3/+183
| | | | | | | sizes or some number of the sizes themselves. It is functionally compatible with a function by the same name under Solaris. Reviewed by: jhb
* Fix setfib(1) section number.brueffer2009-09-181-2/+2
| | | | | | PR: 133765 Submitted by: Konstantin Zolotukhin <erebus@gorodok.net> MFC after: 3 days
* Make libc.a provide __stack_chk_fail_local weak alias. This iskan2009-09-171-0/+4
| | | | | | needed to satisfy static libraries that are compiled with -fpic and linked into static binary afterwards. Several libraries in gcc are examples of such static libs.
* Fix an off-by-one error in the marking of the O_CH operatordds2009-09-161-1/+1
| | | | | | | following an OOR2 operator. PR: 130504 MFC after: 2 weeks
* Add a couple of debugging statements.dds2009-09-161-0/+3
|
* Add EV_RECEIPT to kevents.sson2009-09-161-0/+9
| | | | | | | | EV_RECEIPT is useful to disambiguating error conditions when multiple events structures are passed to kevent(2). The error code is returned in the data field and EV_ERROR is set. Approved by: rwatson (co-mentor)
* Add the EV_DISPATCH flag to kevents.sson2009-09-161-0/+5
| | | | | | | | When the EV_DISPATCH flag is used the event source will be disabled immediately after the delivery of an event. This is similar to the EV_ONESHOT flag but it doesn't delete the event. Approved by: rwatson (co-mentor)
* Add EVFILT_USER to kevents.sson2009-09-161-1/+39
| | | | | | | | | Add user events support to kernel events which are not associated with any kernel mechanism but are triggered by user level code. This is useful for adding user level events to an event handler that may also be monitoring kernel events. Approved by: rwatson (co-mentor)
* Add two test cases from PR 130504.dds2009-09-151-0/+3
| | | | | | | | | | An additional one coming from http://www.research.att.com/~gsf/testregex/ was not added; at some point the entire AT&T regression test harness should be imported here. But that would also mean commitment to fix the uncovered errors. PR: 130504 Submitted by: Chris Kuklewicz
* Improve the way failure of pthread_key_create() gets detected.edwin2009-09-141-2/+9
| | | | | | PR: threads/138603 Submitted by: Mikulas Patocka MFC after: 1 week
* Bump our namespace version for 9.0.deischen2009-09-131-1/+11
| | | | | Add a comment about keeping the private namespace at the end of the dependency chain.
* Make the description of `b' a little better.ed2009-09-091-1/+1
| | | | | | | If you have a one-byte sequence, `w', `b' is the second character. Not the third. Submitted by: Christoph Mallon
* Revert r196976, now that <machine/param.h> behaves predictably.phk2009-09-091-1/+0
|
* Add necessary includephk2009-09-081-0/+1
|
* Synchornize description in manual page with strerror() output.pjd2009-09-061-2/+2
|
* Handle zero size for posix_memalign. Return NULL or unique addresskib2009-09-051-0/+9
| | | | | | | according to the 'V' option. PR: standards/138307 MFC after: 1 week
* Let the armchair generals handle this one.des2009-09-0422-218/+22
|
* Document the need for a cast when passing a char to a ctype function.des2009-09-0322-22/+218
| | | | MFC after: 2 weeks
* Use (unsigned char) cast for ctype macroache2009-09-021-1/+1
|
* Fix regression introduced with NFSv4 ACL support - make acl_to_text(3)trasz2009-09-012-11/+12
| | | | | | | | | and acl_calc_mask(3) return error instead of crashing when acl passed to them is NULL. Submitted by: markus Reviewed by: rwatson MFC after: 3 days
* Style: Remove trailing whitespace.kientzle2009-08-291-11/+11
|
* Consider flag == 0 as the same of flag == R_NEXT. This change will restoredelphij2009-08-241-2/+2
| | | | | a historical behavior that has been changed by revision 190491, and has seen to break exim.
* Our implementation of granpt(3) could be valid in the future.ed2009-08-241-15/+11
| | | | | | | | | | | | | | | | | | | | | When I wrote the pseudo-terminal driver for the MPSAFE TTY code, Robert Watson and I agreed the best way to implement this, would be to let posix_openpt() create a pseudo-terminal with proper permissions in place and let grantpt() and unlockpt() be no-ops. This isn't valid behaviour when looking at the spec. Because I thought it was an elegant solution, I filed a bug report at the Austin Group about this. In their last teleconference, they agreed on this subject. This means that future revisions of POSIX may allow grantpt() and unlockpt() to be no-ops if an open() on /dev/ptmx (if the implementation has such a device) and posix_openpt() already do the right thing. I'd rather put this in the manpage, because simply mentioning we don't comply to any standard makes it look worse than it is. Right now we don't, but at least we took care of it. Approved by: re (kib) MFC after: 3 days
* Update posix1e-related man pages, especially as relates to MAC, to morerwatson2009-08-127-156/+129
| | | | | | accurately reflect the last ten years of work. Approved by: re (kib)
* Eliminate a stale paragraph from the BUGS section. This "bug" wasalc2009-07-261-8/+1
| | | | | | eliminated in r195693. Approved by: re (kensmith)
* It is believed the last subsystem that limited ID sizes to somethingkensmith2009-07-221-7/+18
| | | | | | | | | | other than the current system-wide size (32-bits) has been updated so for now just cautiously turn the check off. While here fix the check for IDs being too large which doesn't work due to type mis-matches. Reviewed by: jhb (previous version) Approved by: re (kib) MFC after: 1 month (type mis-match fixes only)
* Correct AT_SYMLINK_FOLLOW flag name in linkat(2) man page.jilles2009-07-191-1/+1
| | | | Approved by: re (kib), ed (mentor)
* Implement RTLD_NOLOAD flag for dlopen(3).kib2009-07-171-1/+8
| | | | | | Requested and tested by: jkim Reviewed by: kan Approved by: re (kensmith)
* Second attempt at eliminating .text relocations in shared librarieskan2009-07-143-8/+2
| | | | | | | | | | | | | | compiled with stack protector. Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work every time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kib)
* - Change mmap() to fail requests with EINVAL that pass a length of 0. Thisjhb2009-07-141-2/+2
| | | | | | | | | | | | behavior is mandated by POSIX. - Do not fail requests that pass a length greater than SSIZE_MAX (such as > 2GB on 32-bit platforms). The 'len' parameter is actually an unsigned 'size_t' so negative values don't really make sense. Submitted by: Alexander Best alexbestms at math.uni-muenster.de Reviewed by: alc Approved by: re (kib) MFC after: 1 week
* Add missing MLINKS for acl_{get,set}_link_fd(3).trasz2009-07-141-0/+2
| | | | Approved by: re (kib)
* Move msg{snd,recv,get,ctl} manual pages from section 3 to 2.trasz2009-07-137-26/+27
| | | | Approved by: re (kib)
* Fix fwrite() to return 0 when size or nmemb are zero.ed2009-07-122-4/+9
| | | | | | | | Right now nmemb is returned when size is 0. In newer versions of the standards, it is explicitly required that fwrite() should return 0. Submitted by: Christoph Mallon Approved by: re (kib)
* There is an optimization in chmod(1), that makes it not to call chmod(2)trasz2009-07-083-3/+27
| | | | | | | | | | | | | if the new file mode is the same as it was before; however, this optimization must be disabled for filesystems that support NFSv4 ACLs. Chmod uses pathconf(2) to determine whether this is the case - however, pathconf(2) always follows symbolic links, while the 'chmod -h' doesn't. This change adds lpathconf(3) to make it possible to solve that problem in a clean way. Reviewed by: rwatson (earlier version) Approved by: re (kib)
* - Don't suggest opening file for writing in preparation for fexecve(2).pjd2009-07-051-6/+5
| | | | | | - execve(2)/fexecve(2) won't return ETXTBSY if file is open for reading. Approved by: re (kib)
OpenPOWER on IntegriCloud