summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* MFC r275752:trasz2015-01-141-2/+2
| | | | | | Fix quick_exit(3) manual page to match reality - the status was missing. Sponsored by: The FreeBSD Foundation
* MFC discussed with: jilles, -developersngie2015-01-112-8/+18
| | | | | | | | | | | | | MFC r266971: - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX). Update the manpage to reflect this change. - Always set the current position to the first null-byte when opening in append mode. This makes the implementation compatible with glibc's. Update the test suite. Reported by: pho Approved by: cognet
* MFC r276627:kib2015-01-102-0/+8
| | | | | Add rtld private interface for dso to detect dynamic loading vs. static linking.
* MFC r274722:trasz2015-01-071-43/+0
| | | | | | | | Remove acl_size.c; apparently it was never used. PR: 194398 Submitted by: ngie@ Sponsored by: The FreeBSD Foundation
* Merge reaper facility.kib2015-01-051-5/+222
| | | | | | | | | | | | | | | | | | | | | MFC r270443 (by mjg): Properly reparent traced processes when the tracer dies. MFC r273452 (by mjg): Plug unnecessary PRS_NEW check in kern_procctl. MFC 275800: Add a facility for non-init process to declare itself the reaper of the orphaned descendants. MFC r275821: Add missed break. MFC r275846 (by mckusick): Add some additional clarification and fix a few gammer nits. MFC r275847 (by bdrewery): Bump Dd for r275846.
* MFC r275930:delphij2015-01-021-1/+3
| | | | | | Plug a memory leak. Obtained from: DragonFlyBSD (commit 5119ece)
* MFC r274462: Add the ppoll() system call.dchagin2014-12-213-2/+70
|
* MFC r271315 (by joel):kib2014-12-181-59/+84
| | | | | | | Minor mdoc nit. MFC r275806: Markup fixes for kqueue(2), no content changes.
* MFC r268843 (by bapt):kib2014-12-181-3/+20
| | | | Extend kqueue's EVFILT_TIMER by adding precision unit flags support.
* MFC 271635,271722:jhb2014-12-161-14/+24
| | | | | | | | | | | | | | | | - Only the manpage updates from 271635 are merged to give additional heads up for the stricter checks in 11, but the kernel in 10 remains permissive. - Fail with EINVAL if an invalid protection mask is passed to mmap(). - Fail with EINVAL if an unknown flag is passed to mmap(). - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to mmap(). - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. - Remove mention of MAP_INHERIT. It hasn't been implemented for thirteen years. - Remove mention of unimplemented MAP_SWAP. There are no future plans to implement it.
* Clean up our ARM assembly:andrew2014-12-147-123/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC 275256: Switch to the ARM unified assembly language as the clang integrated as only supports it. Binutils supports it when the ".syntax unified" directive is set. Sponsored by: ABT Systems Ltd MFC 275264: Update _ENTRY to use _EENTRY to reduce the common code. MFC 275321: Remove extra labels, ENTRY_NP already provides them. Sponsored by: ABT Systems Ltd MFC 275322: Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND Sponsored by: ABT Systems Ltd MFC 275416: Fix the name of the coprocessor to include the "p" prefix, the clang integrated assembler expects this. Sponsored by: ABT Systems Ltd MFC 275418: Switch to unified syntax so these can be built with clang 3.5. Sponsored by: ABT Systems Ltd MFC 275519: Add missing END macros to some of the xscale functions. Sponsored by: ABT Systems Ltd MFC 275520: Use the unified syntax in a few more assembly files Sponsored by: ABT Systems Ltd MFC 275521: Set the alignment to 4-bytes after a string as clang 3.5 can switch to thumb mode if this is incorrect. Sponsored by: ABT Systems Ltd MFC 275522: Place the literal pool after a RET otherwise clang 3.5 tries to put it too far away from a ldr psuedo instruction. With this clang will place the literal value here where it's close enough to be loaded. Sponsored by: ABT Systems Ltd MFC 275523: Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is unsupported as it needs a newer cpu. Sponsored by: ABT Systems Ltd MFC 275524: Switch to a .cpu directive. These will work when clang 3.5 is imported where the .arch directive is a nop. Sponsored by: ABT Systems Ltd
* MFC r275665:delphij2014-12-101-4/+6
| | | | | | | Fix buffer overflow in stdio. Security: FreeBSD-SA-14:27.stdio Security: CVE-2014-8611
* MFC r275071:delphij2014-12-091-9/+28
| | | | | | | | | | | | | Reinstitate send() after syslogd restarts. In r228193 the test of CONNPRIV have been moved to before the _usleep and send in vsyslog(). When syslogd restarts, this would prevent the message being logged after the disconnect/connect dance for scenario #1. PR: 194751 Submitted by: Peter Creath <pjcreath+freebsd gmail com> Reviewed By: glebius
* MFC r263928:brooks2014-12-061-1/+1
| | | | | | Use the correct variable name in the example code. PR: 195749
* MFC r273854:trasz2014-11-291-5/+9
| | | | | | Update acl(3) to expand on NFSv4 ACL support. Sponsored by: The FreeBSD Foundation
* MFC r273853:trasz2014-11-297-14/+14
| | | | | | Make it clear that ACL flags are NFSv4-only. Sponsored by: The FreeBSD Foundation
* MFC r273760:kevlo2014-11-241-3/+3
| | | | Fix prototypes.
* Always return pathname in dl_iterate_phdr's dlpi_name, as Linux doesemaste2014-11-141-2/+2
| | | | | | | | | | | | | Linux LD_ITERATE_PHDR(3): The dlpi_name field is a null-terminated string giving the pathname from which the shared object was loaded. That functionality is much more useful than returning just the short name. Update dl_iterate_phdr(3) to follow r272842 MFC of r272842 and r272848
* MFC r269956:andrew2014-10-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | From https://sourceware.org/ml/newlib/2014/msg00113.html By Richard Earnshaw at ARM > >GCC has for a number of years provides a set of pre-defined macros for >use with determining the ISA and features of the target during >pre-processing. However, the design was always somewhat cumbersome in >that each new architecture revision created a new define and then >removed the previous one. This meant that it was necessary to keep >updating the support code simply to recognise a new architecture being >added. > >The ACLE specification (ARM C Language Extentions) >(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html) >provides a much more suitable interface and GCC has supported this >since gcc-4.8. > >This patch makes use of the ACLE pre-defines to map to the internal >feature definitions. To support older versions of GCC a compatibility >header is provided that maps the traditional pre-defines onto the new >ACLE ones. Stop using __FreeBSD_ARCH_armv6__ and switch to __ARM_ARCH >= 6 in the couple of places in tree. clang already implements ACLE. Add a define that says we implement version 1.1, even though the implementation isn't quite complete.
* MFC r273088:andrew2014-10-228-1/+337
| | | | | | Add support for the __aeabi_c*cmp* functions. These are similar to the existing functions with the exception they use the condition flags to store the result.
* MFC r272884:delphij2014-10-201-2/+2
| | | | accept(2) may and can return EAGAIN, document it.
* MFC r272562,r272678,r272679ache2014-10-191-5/+6
| | | | | | | | | 1) Fix the case we have less arguments for format string than we expected. 2) Return error on unsupported format specs. (both according to POSIX) 3) For %Z format, understand "UTC" name too. PR: 93197
* MFC r258580:hrs2014-10-099-546/+211
| | | | | | | | | | | | | | | | | | | | | Replace Sun RPC license in TI-RPC library with a 3-clause BSD license, with the explicit permission of Sun Microsystems in 2009. MFC r258581, 258582: Replace Sun Industry Standards Source License for Sun RPC code with a 3-clause BSD license as specified by Oracle America, Inc. in 2010. This license change was approved by Wim Coekaerts, Senior Vice President, Linux and Virtualization at Oracle Corporation. MFC r259117, 259118: Replace Sun RPC license with a 3-clause BSD license. This license change was approved in 2010 by Wim Coekaerts, Senior Vice President, Linux and Virtualization at Oracle Corporation. MFC r259417: Replace Sun RPC license for TI-RPC library with a 3-clause BSD license, with the explicit permission of Sun Microsystems in 2009. The code in question in this file was copied from lib/libc/rpc/pmap_getport.c.
* MFC r272273, r272387, r272443, r272533 :pfg2014-10-082-16/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add strptime(3) support for %U and %W Add support for the missing POSIX-2001 %U and %W features: the existing FreeBSD strptime code recognizes both directives and validates that the week number lies in the permitted range, but then simply discards the value. Initial support for the feature was written by Paul Green. David Carlier added the initial handling of tm_wday/tm_yday. Major credit goes to Andrey Chernov for detecting much of the brokenness and rewriting/cleaning most of the code, making it much more robust. Tested independently with the strptime test from the GNU C library. PR: 137307 Relnotes: yes MFC r272441 : strptime: %s format fix. Almost never needed in real life because %s is tends to be only one format spec. 1) Return code of gmtime_r() is checked. 2) All flags are set. Submitted by: ache
* MFC r270882, r270930:ian2014-09-0922-1/+36
| | | | | | | | | | | | | In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo). The EABI unwind info requires a .fnend for every .fnstart, and newer binutils will complain about seeing two .fnstart in a row. This change allows newer tools to compile our code. Do not generate unwind info in asm functions if _STANDALONE is defined. The .fnend op causes the assembler to emit RELOC references to unwind support functions that don't exist in libstand. Approved by: re(gjb)
* MFC 271048:jhb2014-09-081-1/+1
| | | | | | | | | | | | Always seek back to the beginning of a regular directory, even if the previous seek location was 0. Without this, readdir() would see dd_loc of zero and call getdirentries() which would start reading entries at the current seek location of the directory ignoring the first batch of entries. Also, rewinddir() should always seek so that it reads the directory from the beginning to get updated entries. PR: 192935 Approved by: re (gjb)
* MFC r270215: Add missing break.ume2014-08-301-0/+1
|
* MFC r269873:ume2014-08-301-2/+3
| | | | | | | | | | | | | | | | Fix broken pointer overflow check ns_name_unpack() Many compilers may optimize away the overflow check `msg + l < msg', where `msg' is a pointer and `l' is an integer, because pointer overflow is undefined behavior in C. Use a safe precondition test `l >= eom - msg' instead. Reference: https://android-review.googlesource.com/#/c/50570/ Requested by: pfg Obtained from: NetBSD (CVS rev. 1.10)
* MFC r269867:ume2014-08-3036-199/+909
| | | | | | | Update our stub resolver to final version of libbind (libbind-6.0). Obtained from: ISC
* MFC r269865:ume2014-08-302-0/+6
| | | | | | Bring the md5 functions into libc for internal use only. It is required to support ID randomization for our stub resolver.
* MFC r270519:ngie2014-08-281-0/+1
| | | | | | | | | | | Fix "make checkdpadd" for lib/libc when MK_SSP != no Add LIBSSP_NONSHARED to bsd.libnames.mk and append LIBSSP_NONSHARED to DPADD in lib/libc when MK_SSP != no Approved by: rpaulo (mentor) Phabric: D675 (as part of a larger diff) PR: 192728
* MFC r269945:tuexen2014-08-221-0/+6
| | | | | | | | Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUS socket options. This includes managing the correspoing stat counters. Add the SCTP_DETAILED_STR_STATS kernel option to control per policy counters on every stream. The default is off and only an aggregated counter is available. This is sufficient for the RTCWeb usecase.
* MFC r269858:tuexen2014-08-221-0/+7
| | | | | Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTED socket options. Add also a sysctl to control the support of ASCONF.
* MFC r269527:tuexen2014-08-221-0/+3
| | | | | Add support for the SCTP_RECONFIG_SUPPORTED and the corresponding sysctl controlling the negotiation of the RE-CONFIG extension.
* MFC r269481:tuexen2014-08-221-0/+3
| | | | | | Add support for the SCTP_PKTDROP_SUPPORTED socket option and the corresponding sysctl variable. The default is off, since the specification is not an RFC yet.
* MFC r269475:tuexen2014-08-221-0/+3
| | | | | | | Add SCTP socket option SCTP_NRSACK_SUPPORTED to control the NRSACK extension. The default will still be off, since it it not an RFC (yet). Changing the sysctl name will be in a separate commit.
* MFC r269448:tuexen2014-08-221-0/+3
| | | | | | Add support for the SCTP_PR_SUPPORTED socket option as specified in http://tools.ietf.org/html/draft-ietf-tsvwg-sctp-prpolicies Add also a sysctl controlling the default of the end-points.
* MFC r269436, r269445:tuexen2014-08-221-0/+3
| | | | | | | | Cleanup the ECN configuration handling and provide an SCTP socket option for controlling ECN on future associations and get the status on current associations. A simialar pattern will be used for controlling SCTP extensions in upcoming commits.
* MFC r268924:pfg2014-08-161-9/+16
| | | | | | | | | | | Update fflush(3) to return success on a read-only stream. This is done for compliance with SUSv3. The changes cause no secondary effects in the gnulib tests (we pass them). Obtained from: Apple Inc. (Libc 997.90.3 with changes) Reviewed by: bde Phabric: D440
* MFC r269901:pfg2014-08-161-7/+7
| | | | | | Minor style tweaks. Obtained from: OpenBSD (CVS rev. 1.7)
* MFC r269695:pfg2014-08-161-1/+1
| | | | | | | Const-ify character string Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days
* MFC 268531,269079,269204:jhb2014-08-147-193/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix various edge cases with rewinddir(), seekdir(), and telldir(): - In the unionfs case, opendir() and fdopendir() read the directory's full contents and cache it. This cache is not refreshed when rewinddir() is called, so rewinddir() will not notice updates to a directory. Fix this by splitting the code to fetch a directory's contents out of __opendir_common() into a new _filldir() function and call this from rewinddir() when operating on a unionfs directory. - If rewinddir() is called on a directory opened with fdopendir() before any directory entries are fetched, rewinddir() will not adjust the seek location of the backing file descriptor. If the file descriptor passed to fdopendir() had a non-zero offset, the rewinddir() will not rewind to the beginning. Fix this by always seeking back to 0 in rewinddir(). This means the dd_rewind hack can also be removed. - Add missing locking to rewinddir() - POSIX says that passing a location returned by telldir() to seekdir() after an intervening call to rewinddir() is undefined, so reclaim any pending telldir() cookies in the directory when rewinddir() is called. - If telldir() is called immediately after a call to seekdir(), POSIX requires the return value of telldir() to equal the value passed to seekdir(). The current seekdir code with SINGLEUSE enabled breaks this case as each call to telldir() allocates a new cookie. Instead, remove the SINGLEUSE code and change telldir() to look for an existing cookie for the directory's current location rather than always creating a new cookie. PR: 121656
* MFC r268993, r268893, r268994, plus partial r264070, r264082ian2014-08-104-2/+117
| | | | | | | | Fix C++ exception handling for ARM EABI. Just the part of r264070 that creates the FBSD_1.4 namespace in libc is hand-applied, and then r264082 which creates the Versions.def entry is MFC'd.
* MFC: r269116ache2014-08-061-0/+8
| | | | | | | In the "Too many open files" edge cases don't try to preserve old number for non-std* descriptors, but close old file and retry. Obtained from: inspired by Apple's change from pfg@
* MFC: r268997ache2014-08-061-0/+18
| | | | | | For "a"-mode files and rewind/fseek + fwrite combination return meaningful value now, like Apple does, but avoid their __sflush physical write performance degradation as much as possible.
* MFC r268945:pfg2014-08-041-1/+0
| | | | | | | | | | | | | | | | | | Fix hdestroy() compliance issue. The hcreate(3) implementation and related functions we inherited from NetBSD used to free() the key value, something that is not supported by the standard implementation. This would cause a segmentation fault when attempting to run the examples from the opengroup and linux manpages. There is no need to bump the __FreeBSD_version as we have always claimed XPG4.2 compliance but if some reference is required, the bump for r269484 can be used. Reference: http://bugs.dragonflybsd.org/issues/1398
* MFC r268066:pfg2014-08-032-2/+25
| | | | | | | | | | | | | | | | | | | regex(3): Add support for \< and \> word delimiters Solaris and other OSs have support for \< and \> as word delimiters in utilities like sed(1). These are useful to have for general compatiblity with Solaris but should be avoided for portability with other systems, including the traditional BSDs. Bump __FreeBSD_version as this is likely to affect some userland utilities. Reference: https://www.illumos.org/issues/516 PR: bin/153257 Obtained from: Illumos
* MFC r269124:pfg2014-08-031-37/+46
| | | | | | | | | | | | strftime() xlocale cleanups. Replace fprintf_l with fputs when output is unformatted. Use locale_t in _conv() since it was using sprintf (now sprintf_l) Use locale_t on _yconv() since it calls _conv() Obtained from: Apple Inc. (Libc 997.90.3) CR: D482 Reviewed by: theraven
* MFC r268926, r268930, r268983:pfg2014-08-035-7/+13
| | | | | | | | | | | | Use a correct errno in freopen. Use EBADF instead of EINVAL when working around incorrect O_ACCMODE. Adjust errno on failed prepwrite. rewind: always clear error indicator as required by POSIX. Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442
* MFC r268867, r268878:pfg2014-08-031-1/+2
| | | | | | Use more consistent type for optlen in getsourcefilter() Proposed by: bde
OpenPOWER on IntegriCloud