summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Connect libexecinfo to the buildemaste2013-09-031-0/+1
| | | | Sponsored by: DARPA, AFRL
* Don't install private libexecinfo headersemaste2013-09-031-1/+1
|
* Document SIGLIBRT in signal(3); take a stab at the signal description asrwatson2013-09-031-0/+1
| | | | | | the original committer didn't provide one. MFC after: 3 days
* libexecinfo compatibility with devel/libexecinfo portemaste2013-09-021-0/+4
| | | | | | | 1. Match shlib number 2. Add libelf dependency Suggested by: bapt[1]
* system(): Restore behaviour for SIGINT and SIGQUIT.jilles2013-09-011-0/+2
| | | | | | | | | | | | As mentioned in r16117 and the book "Advanced Programming in the Unix Environment" by W. Richard Stevens, we should ignore SIGINT and SIGQUIT before forking, since it is not guaranteed that the parent process starts running soon enough. To avoid calling sigaction() in the vforked child, instead block SIGINT and SIGQUIT before vfork() and keep the sigaction() to ignore after vfork(). The FreeBSD kernel discards ignored signals, even if they are blocked; therefore, it is not necessary to unblock SIGINT and SIGQUIT earlier.
* libc: Always use our own copy of sys_errlist and sys_nerr (.so only).jilles2013-08-314-4/+56
| | | | | | | | | | | | | | | This ensures strerror() and friends continue to work correctly even if a (non-PIE) executable linked against an older libc imports sys_errlist (which causes sys_errlist to refer to the executable's copy with a size fixed when that executable was linked). The executable's use of sys_errlist remains broken because it uses the current value of sys_nerr and may access past the bounds of the array. Different from the message "Using sys_errlist from executables is not ABI-stable" on freebsd-arch, this change does not affect the static library. There seems no reason to prevent overriding the error messages in the static library.
* Add support to the ARM platform specific section types.andrew2013-08-311-1/+9
|
* Unconditionally compile the __sync_* atomics support functions into compiler-rttheraven2013-08-311-1/+2
| | | | | | | | | for ARM. This is quite ugly, because it has to work around a clang bug that does not allow built-in functions to be defined, even when they're ones that are expected to be built as part of a library. Reviewed by: ed
* The round of expand_number() cleanups.pluknet2013-08-301-29/+10
| | | | | | | | | o Fix range error checking to detect overflow when uint64_t < uintmax_t. o Remove a non-functional check for no valid digits as pointed out by Bruce. o Remove a rather pointless comment describing what the function does. o Clean up a bunch of style bugs. Brucified by: bde
* libutil: Use O_CLOEXEC for internal file descriptors from open().jilles2013-08-285-9/+12
|
* Xref capsicum(4) and procdesc(4) from pdfork(2).rwatson2013-08-281-4/+18
| | | | | Suggested by: sbruno MFC after: 3 days
* * Whitespace.kargl2013-08-281-1/+1
|
* wordexp(): Avoid leaking the pipe file descriptors to a parallel fork/exec.jilles2013-08-271-4/+4
| | | | This uses the new pipe2() system call added on May 1 (r250159).
* * s_erf.c:kargl2013-08-272-99/+71
| | | | | | | | | | | | | | | | | | | | | | . Use integer literal constants instead of double literal constants. * s_erff.c: . Use integer literal constants instead of casting double literal constants to float. . Update the threshold values from those carried over from erf() to values appropriate for float. . New sets of polynomial coefficients for the rational approximations. These coefficients have little, but positive, effect on the maximum error in ULP in the four intervals, but do improve the overall speed of execution. . Remove redundant GET_FLOAT_WORD(ix,x) as hx already contained the contents that is packed into ix. . Update the mask that is used to zero-out lower-order bits in x in the intervals [1.25, 2.857143] and [2.857143, 12]. In tests on amd64, this change improves the maximum error in ULP from 6.27739 and 63.8095 to 3.16774 and 2.92095 on these intervals for erffc(). Reviewed by: bde
* Make the PAM password strength checking module WARNS=2 safe.will2013-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | lib/libpam/modules/pam_passwdqc/Makefile: Bump WARNS to 2. contrib/pam_modules/pam_passwdqc/pam_passwdqc.c: Bump _XOPEN_SOURCE and _XOPEN_VERSION from 500 to 600 so that vsnprint() is declared. Use the two new union types (pam_conv_item_t and pam_text_item_t) to resolve strict aliasing violations caused by casts to comply with the pam_get_item() API taking a "const void **" for all item types. Warnings are generated for casts that create "type puns" (pointers of conflicting sized types that are set to access the same memory location) since these pointers may be used in ways that violate C's strict aliasing rules. Casts to a new type must be performed through a union in order to be compliant, and access must be performed through only one of the union's data types during the lifetime of the union instance. Handle strict-aliasing warnings through pointer assignments, which drastically simplifies this change. Correct a CLANG "printf-like function with more arguments than format" error. Submitted by: gibbs Sponsored by: Spectra Logic
* Add libexecinfo Makefileemaste2013-08-231-0/+19
| | | | Sponsored by: DARPA, AFRL
* libc: Access some unexported variables more efficiently (related to stdio).jilles2013-08-231-2/+2
|
* libc: Make various internal file descriptors from fopen() close-on-exec.jilles2013-08-2313-21/+21
|
* Remove EOL whitespace.joel2013-08-221-1/+1
|
* Update Bind to 9.9.3-P2erwin2013-08-225-88/+74
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable new features: * Elliptic Curve Digital Signature Algorithm keys and signatures in DNSSEC are now supported per RFC 6605. [RT #21918] * Introduces a new tool "dnssec-verify" that validates a signed zone, checking for the correctness of signatures and NSEC/NSEC3 chains. [RT #23673] * BIND now recognizes the TLSA resource record type, created to support IETF DANE (DNS-based Authentication of Named Entities) [RT #28989] * The new "inline-signing" option, in combination with the "auto-dnssec" option that was introduced in BIND 9.7, allows named to sign zones completely transparently. Approved by: delphij (mentor) MFC after: 3 days Sponsored by: DK Hostmaster A/S
| * Vendor import of Bind 9.9.3-P2erwin2013-08-14188-1454/+8393
| | | | | | | | | | Approved by: delphij (mentor, implicit) Sponsored by: DK Hostmaster A/S
* | Even though it doesn't really make sense in the context of a CONNECTdes2013-08-221-0/+2
| | | | | | | | | | | | | | | | | | request, RFC 2616 14.23 mandates the presence of the Host: header in all HTTP 1.1 requests. PR: kern/181445 Submitted by: Kimo <kimor79@yahoo.com> MFC after: 3 days
* | Expand the use of stat(2) flags to allow storing some Windows/DOSken2013-08-212-14/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and CIFS file attributes as BSD stat(2) flags. This work is intended to be compatible with ZFS, the Solaris CIFS server's interaction with ZFS, somewhat compatible with MacOS X, and of course compatible with Windows. The Windows attributes that are implemented were chosen based on the attributes that ZFS already supports. The summary of the flags is as follows: UF_SYSTEM: Command line name: "system" or "usystem" ZFS name: XAT_SYSTEM, ZFS_SYSTEM Windows: FILE_ATTRIBUTE_SYSTEM This flag means that the file is used by the operating system. FreeBSD does not enforce any special handling when this flag is set. UF_SPARSE: Command line name: "sparse" or "usparse" ZFS name: XAT_SPARSE, ZFS_SPARSE Windows: FILE_ATTRIBUTE_SPARSE_FILE This flag means that the file is sparse. Although ZFS may modify this in some situations, there is not generally any special handling for this flag. UF_OFFLINE: Command line name: "offline" or "uoffline" ZFS name: XAT_OFFLINE, ZFS_OFFLINE Windows: FILE_ATTRIBUTE_OFFLINE This flag means that the file has been moved to offline storage. FreeBSD does not have any special handling for this flag. UF_REPARSE: Command line name: "reparse" or "ureparse" ZFS name: XAT_REPARSE, ZFS_REPARSE Windows: FILE_ATTRIBUTE_REPARSE_POINT This flag means that the file is a Windows reparse point. ZFS has special handling code for reparse points, but we don't currently have the other supporting infrastructure for them. UF_HIDDEN: Command line name: "hidden" or "uhidden" ZFS name: XAT_HIDDEN, ZFS_HIDDEN Windows: FILE_ATTRIBUTE_HIDDEN This flag means that the file may be excluded from a directory listing if the application honors it. FreeBSD has no special handling for this flag. The name and bit definition for UF_HIDDEN are identical to the definition in MacOS X. UF_READONLY: Command line name: "urdonly", "rdonly", "readonly" ZFS name: XAT_READONLY, ZFS_READONLY Windows: FILE_ATTRIBUTE_READONLY This flag means that the file may not written or appended, but its attributes may be changed. ZFS currently enforces this flag, but Illumos developers have discussed disabling enforcement. The behavior of this flag is different than MacOS X. MacOS X uses UF_IMMUTABLE to represent the DOS readonly permission, but that flag has a stronger meaning than the semantics of DOS readonly permissions. UF_ARCHIVE: Command line name: "uarch", "uarchive" ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE Windows name: FILE_ATTRIBUTE_ARCHIVE The UF_ARCHIVED flag means that the file has changed and needs to be archived. The meaning is same as the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute. msdosfs and ZFS have special handling for this flag. i.e. they will set it when the file changes. sys/param.h: Bump __FreeBSD_version to 1000047 for the addition of new stat(2) flags. chflags.1: Document the new command line flag names (e.g. "system", "hidden") available to the user. ls.1: Reference chflags(1) for a list of file flags and their meanings. strtofflags.c: Implement the mapping between the new command line flag names and new stat(2) flags. chflags.2: Document all of the new stat(2) flags, and explain the intended behavior in a little more detail. Explain how they map to Windows file attributes. Different filesystems behave differently with respect to flags, so warn the application developer to take care when using them. zfs_vnops.c: Add support for getting and setting the UF_ARCHIVE, UF_READONLY, UF_SYSTEM, UF_HIDDEN, UF_REPARSE, UF_OFFLINE, and UF_SPARSE flags. All of these flags are implemented using attributes that ZFS already supports, so the on-disk format has not changed. ZFS currently doesn't allow setting the UF_REPARSE flag, and we don't really have the other infrastructure to support reparse points. msdosfs_denode.c, msdosfs_vnops.c: Add support for getting and setting UF_HIDDEN, UF_SYSTEM and UF_READONLY in MSDOSFS. It supported SF_ARCHIVED, but this has been changed to be UF_ARCHIVE, which has the same semantics as the DOS archive attribute instead of inverse semantics like SF_ARCHIVED. After discussion with Bruce Evans, change several things in the msdosfs behavior: Use UF_READONLY to indicate whether a file is writeable instead of file permissions, but don't actually enforce it. Refuse to change attributes on the root directory, because it is special in FAT filesystems, but allow most other attribute changes on directories. Don't set the archive attribute on a directory when its modification time is updated. Windows and DOS don't set the archive attribute in that scenario, so we are now bug-for-bug compatible. smbfs_node.c, smbfs_vnops.c: Add support for UF_HIDDEN, UF_SYSTEM, UF_READONLY and UF_ARCHIVE in SMBFS. This is similar to changes that Apple has made in their version of SMBFS (as of smb-583.8, posted on opensource.apple.com), but not quite the same. We map SMB_FA_READONLY to UF_READONLY, because UF_READONLY is intended to match the semantics of the DOS readonly flag. The MacOS X code maps both UF_IMMUTABLE and SF_IMMUTABLE to SMB_FA_READONLY, but the immutable flags have stronger meaning than the DOS readonly bit. stat.h: Add definitions for UF_SYSTEM, UF_SPARSE, UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, UF_READONLY and UF_HIDDEN. The definition of UF_HIDDEN is the same as the MacOS X definition. Add commented-out definitions of UF_COMPRESSED and UF_TRACKED. They are defined in MacOS X (as of 10.8.2), but we do not implement them (yet). ufs_vnops.c: Add support for getting and setting UF_ARCHIVE, UF_HIDDEN, UF_OFFLINE, UF_READONLY, UF_REPARSE, UF_SPARSE, and UF_SYSTEM in UFS. Alphabetize the flags that are supported. These new flags are only stored, UFS does not take any action if the flag is set. Sponsored by: Spectra Logic Reviewed by: bde (earlier version)
* | Reset errno before strtoumax() call to properly detect ERANGE.pluknet2013-08-211-0/+7
| | | | | | | | | | | | | | | | Restore saved errno if strtoumax() call is successful. Reported by: ache Reviewed by: jilles MFC after: 1 week
* | Check strtoumax(3) for ERANGE in case of non-prefixed string.pluknet2013-08-211-0/+4
| | | | | | | | | | OK'd by: silence on current@ MFC after: 1 week
* | Implement fdclosedir(3) function, which is equivalent to the closedir(3)pjd2013-08-183-3/+24
| | | | | | | | | | | | | | function, but returns directory file descriptor instead of closing it. Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Sponsored by: Google Summer of Code 2013
* | Remove redundant space.pjd2013-08-181-1/+1
| |
* | dup3(3): Replace copyright notice.jilles2013-08-181-8/+4
| | | | | | | | | | | | | | Although I copied dup(2) to create dup3(3), I removed almost all the non-boilerplate, so dup3(3) is copyright me. Reported by: bjk
* | Consistently use 'af' as an argument name for address family.pjd2013-08-181-2/+2
| | | | | | | | | | Now both gethostbyname2(3) and gethostbyaddr(3) use the same argument name. The same argument name is also used in implementations of those functions.
* | Make example more correct (errstr is a pointer, not boolean).pjd2013-08-181-1/+1
| |
* | libc: Access _logname_valid more efficiently.jilles2013-08-173-14/+2
| | | | | | | | | | | | | | | | | | | | | | The variable _logname_valid is not exported via the version script; therefore, change C and i386/amd64 assembler code to remove indirection (which allowed interposition). This makes the code slightly smaller and faster. Also, remove #define PIC_GOT from i386/amd64 in !PIC mode. Without PIC, there is no place containing the address of each variable, so there is no possible definition for PIC_GOT.
* | Correct function name and return value.pjd2013-08-171-2/+2
| |
* | Ensure we set all fpu registers to zero by using the address and size ofandrew2013-08-171-1/+1
| | | | | | | | the union over one of its members.
* | Add new mmap(2) flags to permit applications to request specific virtualjhb2013-08-161-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | address alignment of mappings. - MAP_ALIGNED(n) requests a mapping aligned on a boundary of (1 << n). Requests for n >= number of bits in a pointer or less than the size of a page fail with EINVAL. This matches the API provided by NetBSD. - MAP_ALIGNED_SUPER is a special case of MAP_ALIGNED. It can be used to optimize the chances of using large pages. By default it will align the mapping on a large page boundary (the system is free to choose any large page size to align to that seems best for the mapping request). However, if the object being mapped is already using large pages, then it will align the virtual mapping to match the existing large pages in the object instead. - Internally, VMFS_ALIGNED_SPACE is now renamed to VMFS_SUPER_SPACE, and VMFS_ALIGNED_SPACE(n) is repurposed for specifying a specific alignment. MAP_ALIGNED(n) maps to using VMFS_ALIGNED_SPACE(n), while MAP_ALIGNED_SUPER maps to VMFS_SUPER_SPACE. - mmap() of a device object now uses VMFS_OPTIMAL_SPACE rather than explicitly using VMFS_SUPER_SPACE. All device objects are forced to use a specific color on creation, so VMFS_OPTIMAL_SPACE is effectively equivalent. Reviewed by: alc MFC after: 1 month
* | pselect(2): Add xref to sigsuspend(2).jilles2013-08-161-2/+3
| |
* | Add man page dup3(3).jilles2013-08-163-1/+123
| |
* | Add dup3(), based on F_DUP2FD and F_DUP2FD_CLOEXEC fcntls.jilles2013-08-163-0/+61
| | | | | | | | | | | | | | | | I removed functionality not proposed for POSIX in Austin group issue #411. A man page (my own) and test cases will follow in later commits. PR: 176233 Submitted by: Jukka Ukkonen
* | GC unused source file.des2013-08-161-178/+0
| |
* | sigsuspend(2): Add xrefs to pselect(2) and sigwait-alikes.jilles2013-08-151-1/+5
| |
* | libc: Use O_CLOEXEC when writing gmon files (cc -pg).jilles2013-08-131-2/+2
| |
* | vfork(2) was listed as deprecated in 1994 (r1573) and was the falsepeter2013-08-131-19/+19
| | | | | | | | | | | | | | | | | | | | | | reports of its impending demise were removed in 2009 (r199257). However, in 1996 (r16117) system(3) was switched from vfork(2) to fork(2) based partly on this. Switch back to vfork(2). This has a dramatic effect in cases of extreme mmap use - such as excessive abuse (500+) of shared libraries. popen(3) has used vfork(2) for a while. vfork(2) isn't going anywhere.
* | db: Use O_CLOEXEC instead of separate fcntl() call.jilles2013-08-132-8/+3
| |
* | Expose _citrus_bcs_trunc_rws_len for libintl's use.peter2013-08-131-0/+1
| | | | | | | | Submitted by: Jan Beich <jbeich@tormail.org>
* | Turn off warns for this do-nothing file. clang noticed.peter2013-08-131-0/+2
| |
* | The iconv in libc did two things - implement the standard APIs, the GNUpeter2013-08-136-17/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extensions and also tried to be link time compatible with ports libiconv. This splits that functionality and enables the parts that shouldn't interfere with the port by default. WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker symbols and even a stub libiconv.so.3 that are good enough to be able to 'pkg delete -f libiconv' on a running system and reasonably expect it to work. I have tortured many machines over the last few days to try and reduce the possibilities of foot-shooting as much as I can. I've successfully recompiled to enable and disable the libiconv_compat modes, ports that use libiconv alongside system iconv etc. If you don't enable the WITH_LIBICONV_COMPAT switch, they don't share symbol space. This is an extension of behavior on other system. iconv(3) is a standard libc interface and libiconv port expects to be able to run alongside it on systems that have it. Bumped osreldate.
* | db/hash: Use O_CLOEXEC instead of separate fcntl() call.jilles2013-08-111-2/+1
| | | | | | | | | | | | In particular, a hash db is used by getpwnam() and getpwuid(). MFC after: 1 week
* | Fix the return value when we found a symbol in .dynstr. This nasty bug wasrpaulo2013-08-101-0/+1
| | | | | | | | preventing a lot of symbol lookups in dtruss -s, for example.
* | Add mkostemp() and mkostemps().jilles2013-08-094-21/+106
| | | | | | | | | | These are like mkstemp() and mkstemps() but allow passing open(2) flags like O_CLOEXEC.
* | According to POSIX \ in the fnmatch(3) pattern should escapeache2013-08-081-2/+0
| | | | | | | | | | | | | | | | | | | | any character including '\0', but our version replace escaped '\0' with '\\'. I.e. fnmatch("\\", "\\", 0) should not match while fnmatch("\\", "", 0) should (Linux and NetBSD does the same). Was vice versa. PR: 181129 MFC after: 1 week
* | Our libc iconv (unlike gnu iconv and the citrus code in NetBSD) has apeter2013-08-081-0/+13
| | | | | | | | | | | | | | | | bypass mode when src == dst. Unfortunately, there are tools in ports that pass byte streams through iconv to determine if the encodings are valid. eg: gettext-0.18.3+. Disable the optimization and behave like the other implementations.
OpenPOWER on IntegriCloud