summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Import stdbuf(1) and the shared library it relies on.jlh2012-04-281-0/+4
| | | | | | | | | | | | | | This tool changes the default buffering behaviour of standard stdio streams. It only works on dynamic binaries. To make it work for static ones it would require cluttering stdio because there no single entry point. PR: 166660 Reviewed by: current@, jhb Approved by: kib (mentor) MFC after: 1 week
* Fix several memory and lock leaks on the out of memory condition.kib2012-04-282-2/+22
| | | | | Reported by: Matt Miller <matt matthewjmiller net> MFC after: 1 week
* Move sctp_sendv and sctp_recvv to FBSD_1.3 as suggested bytuexen2012-04-261-2/+5
| | | | | | | Konstantin Belousov. MFC after: 1 week. X-MFC with: r234715
* Export symbols for sctp_sendv() and sctp_recvv().tuexen2012-04-261-0/+2
| | | | MFC after: 1 week
* Use the .Bx macro instead of BSDeadler2012-04-261-1/+3
| | | | | | | Submitted by: ru Approved by: ru MFC after: 3 days X-MFC-With: r234700
* A new jail(8) with a configuration file, ultimately to replace the workjamie2012-04-261-39/+1
|\ | | | | | | | | | | currently done by /etc/rc.d/jail. MFC after: 3 months
| * Remove a section that went to jail(8), and fix a small grammar error.jamie2010-10-201-39/+1
| |
| * Import section 2 man files so I can update jail(2).jamie2010-10-20192-0/+34710
| |\
| * | A new jail(8) with a configuration file, to replace the work currently donejamie2010-10-191949-350043/+0
| | | | | | | | | | | | by /etc/rc.d/jail.
* | | Document the standardization status of err* and warn*eadler2012-04-261-1/+11
| | | | | | | | | | | | | | | | | | | | | PR: docs/164939 Submitted by: Niclas Zeising <zeising@daemonic.se> Approved by: bcr MFC after: 3 days
* | | Take the spinlock around clearing of the fp->_flags in fclose(3), whichkib2012-04-243-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | indicates the avaliability of FILE, to prevent possible reordering of the writes as seen by other CPUs. Reported by: Fengwei yin <yfw.bsd gmail com> Reviewed by: jhb MFC after: 1 week
* | | Bugfix: Include whitespace characters in the count of the number ofdas2012-04-221-1/+1
| | | | | | | | | | | | characters read.
* | | Bugfix: Correctly count the number of characters read for %l[ conversions.das2012-04-221-7/+4
| | |
* | | Bugfix: %n doesn't count as a conversion, sodas2012-04-222-2/+0
| | | | | | | | | | | | sscanf("abc", "ab%ncd", &i) returns EOF, not 0.
* | | Refactor scanf to improve modularity. Conversions are now performeddas2012-04-222-668/+843
| | | | | | | | | | | | | | | | | | by separate conversion functions. This will hopefully make bugs more noticeable (I noticed several already) and provide opportunities to reduce code duplication.
* | | Fix some incorrect symbol versions.theraven2012-04-221-4/+4
| | | | | | | | | | | | Reported by: das
* | | Import jemalloc a8f8d7540d66ddee7337db80c92890916e1063ca (dev branch,jasone2012-04-221-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | prior to 3.0.0 release). This fixes several bugs related to memory initialization. Mangle __jemalloc_a0{malloc,calloc,free}() just like all the other library-internal symbols in jemalloc, and adjust the tls allocation code in libc to use the mangled names.
* | | - Use quote when tab is used;delphij2012-04-221-2/+3
| | | | | | | | | | | | - Follow the same macros used in device driver manual pages.
* | | As noted by Peter Jeremy, r234528 only partially fixed the infinitedas2012-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | loop bug introduced in r187302. This completes the fix. PR: 167039 MFC after: 3 days
* | | If the size passed to {,v}s{w,n}printf is larger than INT_MAX+1das2012-04-215-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (i.e., the return value would overflow), set errno to EOVERFLOW and return an error. This improves the chances that buggy applications -- for instance, ones that pass in a negative integer as the size due to a bogus calculation -- will fail in safe ways. Returning an error in these situations is specified by POSIX, but POSIX appears to have an off-by-one error that isn't duplicated in this change. Previously, some of these functions would silently cap the size at INT_MAX+1, and others would exit with an error after writing more than INT_MAX characters. PR: 39256 MFC after: 2 weeks
* | | - Fix the claim that the output is always null-terminated. This isn'tdas2012-04-211-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | true if the size is zero. - Fix a claim that sprintf() is the same as snprintf() with an infinite size. It's equivalent to snprintf() with a size of INT_MAX + 1. - Document the return values in the return values section. - Document the possible errno value of EOVERFLOW. MFC after: 2 weeks
* | | Ensure that the {,v}swprintf functions always null-terminate thedas2012-04-211-0/+3
| | | | | | | | | | | | output string, even if an encoding error or malloc failure occurs.
* | | Fix a bug introduced in r187302 that was causing fputws() to enter andas2012-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | infinite loop pretty much unconditionally. It's remarkable that the patch that introduced the bug was never tested, but even more remarkable that nobody noticed for over two years. PR: 167039 MFC after: 3 days
* | | Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch,jasone2012-04-1713-8250/+182
| | | | | | | | | | | | | | | | | | | | | | | | prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc. The code being imported by this commit diverged from lib/libc/stdlib/malloc.c in March 2010, which means that a portion of the jemalloc 1.0.0 ChangeLog entries are relevant, as are the entries for all subsequent releases.
* | | Replace the C implementation of __aeabi_read_tp with an assembly version.andrew2012-04-162-14/+9
| | | | | | | | | | | | | | | | | | This ensures we follow the ABI by preserving registers r1-r3. Reviewed by: jmallett, imp
* | | When searching for uninitialized memory usage add ensure that the entireeadler2012-04-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct is set to zero. PR: bin/166483 Submitted by: Roy Marples <roy@marples.name> Reviewed by: delphij Approved by: cperciva MFC after: 3 days
* | | Additional manual page updates for r234103.jh2012-04-131-8/+12
| | | | | | | | | | | | Submitted by: bde
* | | Return EBADF instead of EMFILE from dup2 when the second argument iseadler2012-04-112-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | outside the range of valid file descriptors PR: kern/164970 Submitted by: Peter Jeremy <peterjeremy@acm.org> Reviewed by: jilles Approved by: cperciva MFC after: 1 week
* | | Do not restore the register holding the TLS pointer when doing variousnwhitehorn2012-04-116-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usermode context switches (long jumps and ucontext operations). If these are used across threads, multiple threads can end up with the same TLS base. Madness will then result. This makes behavior on PPC match that on x86 systems and on Linux. MFC after: 10 days
* | | - Return EPERM from ufs_setattr() when an user without PRIV_VFS_SYSFLAGSjh2012-04-101-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | privilege attempts to toggle SF_SETTABLE flags. - Use the '^' operator in the SF_SNAPSHOT anti-toggling check. Flags are now stored to ip->i_flags in one place after all checks. Submitted by: bde
* | | sem_open: Make sure to fail an O_CREAT|O_EXCL open, even if that semaphorejilles2012-04-091-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is already open in this process. If the named semaphore is already open, sem_open() only increments a reference count and did not take the flags into account (which otherwise happens by passing them to open()). Add an extra check for O_CREAT|O_EXCL. PR: kern/166706 Reviewed by: davidxu MFC after: 10 days
* | | Unlike other functions __aeabi_read_tp function must preserve r1-r3. Theandrew2012-04-081-2/+5
| | | | | | | | | | | | | | | | | | | | | currently generated code clobbers r3. Fix this by loading ARM_TP_ADDRESS using inline assembly. Approved by: imp (mentor)
* | | - Revert part of r234005, which I did not intend to commit.stas2012-04-071-1/+1
| | | | | | | | | | | | Sorry! :(
* | | - Add kernel config file for QEMU-emulated gumstix board.stas2012-04-071-1/+1
| | |
* | | Properly resolve the _ctx_start function descriptor (the symbol _ctx_startnwhitehorn2012-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | is a descriptor, not a code address), which prevents crashes when starting a context. This fixes QEMU on powerpc64. MFC after: 3 days
* | | mdoc: fix function type.joel2012-04-071-1/+1
| | |
* | | mdoc: fix column names, indentation, column separation within each row, andjoel2012-04-0711-96/+97
| | | | | | | | | | | | | | | | | | | | | quotation. Also make sure we have the same amount of columns in each row as the number of columns we specify in the head arguments. Reviewed by: brueffer
* | | In sem_post, the field _has_waiters is no longer used, because somedavidxu2012-04-051-16/+8
| | | | | | | | | | | | | | | | | | | | | application destroys semaphore after sem_wait returns. Just enter kernel to wake up sleeping threads, only update _has_waiters if it is safe. While here, check if the value exceed SEM_VALUE_MAX and return EOVERFLOW if this is true.
* | | Eliminate two cases of unwanted strncpy(). The name is not requireddelphij2012-04-022-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | by the current code, and the results would get overwritten anyway by subsequent memset(). Reviewed by: ume MFC after: 1 month
* | | Remove unnecessary Xo/Xc.joel2012-03-291-10/+5
| | | | | | | | | | | | Reviewed by: brueffer
* | | mdoc: Ud takes no argument.joel2012-03-291-1/+1
| | |
* | | mandoc complains loudly when <TAB>s are misused in columnated lists. Fixjoel2012-03-296-50/+50
| | | | | | | | | | | | | | | this syntax violation and while I'm here also convert <TAB> to Ta and adjust quotation marks in order to prevent this problem in the future.
* | | Remove trailing whitespace per mdoc lint warningeadler2012-03-2939-112/+112
| | | | | | | | | | | | | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* | | Fix comment to specify correct struct name.jimharris2012-03-281-2/+2
| | | | | | | | | | | | | | | Reviewed by: gjb Approved by: sbruno
* | | Fix Fo arguments.joel2012-03-281-1/+1
| | | | | | | | | | | | Reviewed by: gabor
* | | mdoc: add missing El macro.joel2012-03-271-0/+2
| | |
* | | Minor indentation and paragraph nits.joel2012-03-271-4/+4
| | |
* | | Minor mdoc nit.joel2012-03-271-1/+1
| | |
* | | mdoc: correct .Bd/.Bl arguments.joel2012-03-262-7/+7
| | | | | | | | | | | | Reviewed by: brueffer
* | | mdoc: sort prologue macros.joel2012-03-263-3/+3
| | |
OpenPOWER on IntegriCloud