summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
Commit message (Collapse)AuthorAgeFilesLines
* Fix whitespace inconsistencies in libc in files copyrighted by me.ed2011-06-264-7/+7
|
* Sync with OpenBSD, primarily make the code easier to read, and a licensedelphij2011-06-182-68/+54
| | | | | | | change to standard OpenBSD ISC license. Obtained from: OpenBSD MFC after: 2 weeks
* Sync with OpenBSD (zap rcsid).delphij2011-06-181-7/+1
| | | | MFC after: 2 weeks
* posix_spawn(3): Document r222511 (trying to close already closed fd).jilles2011-06-171-9/+14
| | | | MFC after: 1 week
* Use size of int to fetch sysctl kern.sched.cpusetsize because it haddavidxu2011-06-161-3/+3
| | | | | | switched from long to int type in kernel. Fixed by: pluknet
* posix_spawn(): Do not fail when trying to close an fd that is not open.jilles2011-05-301-5/+2
| | | | | | | | | | | As noted in Austin Group issue #370 (an interpretation has been issued), failing posix_spawn() because an fd specified with posix_spawn_file_actions_addclose() is not open is unnecessarily harsh, and there are existing implementations that do not fail posix_spawn() for this reason. Reviewed by: ed MFC after: 10 days
* [mdoc] Fixed .Dt call.ru2011-05-251-1/+1
|
* Remove vestiges of disklabel(5).pluknet2011-04-141-1/+0
| | | | | Reviewed by: uqs MFC after: 5 days
* Allow strerror(0) and strerror_r(0, ...).jilles2011-04-051-1/+1
| | | | | | | | | | | | | Of course, strerror_r() may still fail with ERANGE. Although the POSIX specification said this could fail with EINVAL and doing this likely indicates invalid use of errno, most other implementations permitted it, various POSIX testsuites require it to work (matching the older sys_errlist array) and apparently some applications depend on it. PR: standards/151316 MFC after: 1 week
* Use FD_CLOEXEC explicitly.pluknet2011-03-301-1/+1
| | | | MFC after: 3 days
* Don't calculate len too early.pjd2011-03-261-1/+1
|
* Follow style(9) in example code and handle opendir(3) error.pjd2011-03-261-4/+7
|
* From fts.c comment:pjd2011-03-162-0/+2
| | | | | | | | | | | | | | The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it knows that a directory could not possibly have subdirectories. This is decided by looking at the link count: a subdirectory would increment its parent's link count by virtue of its own ".." entry. This assumption only holds for UFS-like filesystems that implement links and directories this way, so we must punt for others. It looks like ZFS is a UFS-like file system, as the above also holds for ZFS. Add ZFS to the list of file systems that allow for such optimization. MFC after: 1 month
* Add text string for ECAPMODE to libc.rwatson2011-03-031-0/+1
| | | | | | | Discussed with: anderson Obtained from: Capsicum Project Sponsored by: Google, Inc. MFC after: 3 months
* Fix style(9) issues in pututxline(3).ed2011-02-251-5/+10
| | | | | | | Also, make sure to initialize the `ret' variable properly. Reported by: Cedric Jonas <cedric c84 eu> Patch by: Garrett Cooper <yanegomi gmail com>
* Add a utility, utxrm(8).ed2011-02-191-2/+3
| | | | | | | | | | Most of the ports I broke when I imported utmpx, were simple management utilities for the utmp database, allowing you to add/remove entries manually. Add a small tool called utxrm(8), which allows you to remove an entry from the utmpx database by hand. This is useful when a login daemon crashes or fails to remove the entry during shutdown.
* Properly styleify utmpx code and document error codes in man page.ed2011-02-194-56/+107
| | | | Submitted by: Garrett Cooper
* Turn off default generation of userland dot symbols on powerpc64 now thatnwhitehorn2011-02-181-1/+1
| | | | | we have a binutils that supports it. Kernel dot symbols remain on to assist DDB.
* Don't forget to bump man page date for r218711.ed2011-02-151-1/+1
|
* Remove dead reference to regexp(3). Use regex(3) instead.ed2011-02-151-1/+1
| | | | | PR: docs/149950 Submitted by: arundel@
* Document some more sysconf(3) variables.brucec2011-02-131-1/+58
| | | | MFC after: 1 month
* rfork_thread(3): Mark deprecated in favor of pthread_create(3).jilles2011-02-061-2/+10
|
* Make sys_signame upper case.jilles2011-02-042-33/+33
| | | | | | | | | | | | This matches the constants from <signal.h> with 'SIG' removed, which POSIX requires kill and trap to accept and 'kill -l' to write. 'kill -l', 'trap', 'trap -l' output is now upper case. In Turkish locales, signal names with an upper case 'I' are now accepted, while signal names with a lower case 'i' are no longer accepted, and the output of 'killall -l' now contains proper capital 'I' without dot instead of a dotted capital 'I'.
* Implement __pthread_map_stacks_exec() callback for libc, to change thekib2011-01-083-0/+39
| | | | stack protection to allow execution for single-threaded processes.
* Always set errno to a sane value when pututxline(3) fails.ed2010-11-141-0/+3
| | | | | For example, it will now return ESRCH when trying to replace a nonexistent entry with DEAD_PROCESS.
* Sync with OpenBSD, primarily better signal and terminal handling.delphij2010-11-132-124/+130
| | | | | Obtained from: OpenBSD MFC after: 2 weeks
* Add a new libc function: cfmakesane(3).ed2010-11-024-6/+37
| | | | | | | | | | | I've noticed various terminal emulators that need to obtain a sane default termios structure use very complex `hacks'. Even though POSIX doesn't provide any functionality for this, extend our termios API with cfmakesane(3), which is similar to the commonly supported cfmakeraw(3), except that it fills the termios structure with sane defaults. Change all code in our base system to use this function, instead of depending on <sys/ttydefaults.h> to provide TTYDEF_*.
* Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,davidxu2010-10-291-0/+9
| | | | | | also add sysconf() key _SC_CPUSET_SIZE to get sysctl value. Submitted by: gcooper
* Fix error handling logic of pututxline(3).ed2010-10-211-12/+21
| | | | | | Instead of only returning NULL when the entry is invalid and can't be matched against the current database, also return it when it cannot open the log files properly.
* mdoc: drop redundant .Pp and .LP callsuqs2010-10-084-4/+0
| | | | They have no effect when coming in pairs, or before .Bl/.Bd
* To support stack unwinding for cancellation points, add -fexceptions flagdavidxu2010-09-255-53/+31
| | | | | | | for them, two functions _pthread_cancel_enter and _pthread_cancel_leave are added to let thread enter and leave a cancellation point, it also makes it possible that other functions can be cancellation points in libraries without having to be rewritten in libthr.
* Powerpc is special here. powerpc and powerpc64 use different ABIs, soimp2010-08-241-4/+2
| | | | | | their implementations aren't in the same files. Introduce LIBC_ARCH and use that in preference to MACHINE_CPUARCH. Tested by amd64 and powerpc64 builds (thanks nathanw@)
* MFtbemd:imp2010-08-231-3/+3
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* On shared object unload, in __cxa_finalize, call and clear all installedkib2010-08-233-1/+49
| | | | | | | | | | | | | | | | | | | | | | atexit and __cxa_atexit handlers that are either installed by unloaded dso, or points to the functions provided by the dso. Use _rtld_addr_phdr to locate segment information from the address of private variable belonging to the dso, supplied by crtstuff.c. Provide utility function __elf_phdr_match_addr to do the match of address against dso executable segment. Call back into libthr from __cxa_finalize using weak __pthread_cxa_finalize symbol to remove any atfork handler which function points into unloaded object. The rtld needs private __pthread_cxa_finalize symbol to not require resolution of the weak undefined symbol at initialization time. This cannot work, since rtld is relocated before sym_zero is set up. Idea by: kan Reviewed by: kan (previous version) MFC after: 3 weeks
* Introduce implementation-private rtld interface _rtld_addr_phdr, whichkib2010-08-232-0/+9
| | | | | | | | fills struct dl_phdr_info for the shared object that contains the specified address, if any. Idea and reviewed by: kan MFC after: 3 weeks
* Use aux vector to get values for SSP canary, pagesize, pagesizes array,kib2010-08-177-15/+191
| | | | | | | | | | | number of host CPUs and osreldate. This eliminates the last sysctl(2) calls from the dynamically linked image startup. No objections from: kan Tested by: marius (sparc64) MFC after: 1 month
* Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki whilejoel2010-08-161-1/+1
| | | | | | translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
* Spelling fixes.joel2010-08-021-1/+1
|
* Also link getutxent.3 to utmpx.3.ed2010-07-211-1/+1
| | | | If you run `man utmpx', you expect to get some info on it.
* The 64-bit PowerPC ABI implemented in binutils 2.15 requires some specialnwhitehorn2010-07-101-1/+2
| | | | | | | | | | | quirks for weak-symbol handling. Text symbols require also marking weak the special dot-symbol associated with the function, and data symbols require that you not do that. To fix this, provide a hacked __weak_reference for powerpc64, and define a new __weak_reference_data for the single weak data symbol in base. Revert after: binutils 2.17 import Obtained from: projects/ppc64
* mdoc: stop abusing -column lists and use .Bl -tag insteaduqs2010-06-111-19/+21
|
* mdoc: spell macros correctly, there's no need for the backslash escapeuqs2010-06-021-1/+1
|
* mdoc: consistently spell our email addresses <foo@FreeBSD.org>uqs2010-05-194-4/+4
| | | | Reviewed by: ru
* mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to theuqs2010-05-131-6/+6
| | | | | | | | | | | bottom of the manpages and order them consistently. GNU groff doesn't care about the ordering, and doesn't even mention CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put them. Found by: mdocml lint run Reviewed by: ru
* Fix a bug due to a type conversion from 64 to 32 bits. The side effect ofgordon2010-05-121-2/+2
| | | | | | | | | | this type conversion is the high bits which were used to indicate if a special character was a literal or special were dropped. As a result, all special character were treated as special, even if they were supposed to be literals. Reviewed by: gad@ Approved by: mentor (wes@)
* raise(3): Note that this sends a signal to the current thread, not process.jilles2010-05-071-3/+3
| | | | | | | This is how it works (with threading libraries loaded) and what POSIX requires. MFC after: 1 week
* Update xrefs from 4.3BSD to modern signal functions in various man pages.jilles2010-05-063-7/+5
| | | | | | | sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2). Some legacy man pages still refer to them, that is OK.
* sysctl(3): Update description of various kern.* variables.jilles2010-04-251-12/+10
| | | | | | | | Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3) (which is a more convenient way to access some of the variables). PR: 116480 MFC after: 1 week
* getcwd(3): Clarify that EACCES may or may not be checked.jilles2010-04-171-3/+11
| | | | | | | | | | | | | | | | POSIX permits but does not require checking access on the current and parent directories. Because various programs do not like it if getcwd(3) fails, it seems best to avoid checking access as much as possible. There are various reports in GNATS about this (search for getcwd). Our getcwd(3) implementation first queries the kernel for the pathname directly, which does not check any permissions but sometimes fails, and then falls back to reading all parent directories for the names. PR: standards/44425 MFC after: 2 weeks
* fnmatch: Fix bad FNM_PERIOD disabling if an asterisk has been seen.jilles2010-04-161-8/+8
| | | | | | | Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD) PR: 116074 MFC after: 1 week
OpenPOWER on IntegriCloud