summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* MFC 264162: Accept RFC 2292 option values so that RFC 2292 compliantmarcel2014-08-031-6/+18
| | | | | | programs that are unaware of RFC 3542 can construct control messages. Obtained from: Juniper Networks, Inc.
* MFC 264161: Handle the fact that the getlogin_basic() function can returnmarcel2014-08-031-3/+8
| | | | | | a 0 status with a NULL pointer for the login name (result). Obtained from: Juniper Networks, Inc.
* MFC r268446:markj2014-07-291-1/+1
| | | | Fix a typo.
* MFC r268985, r269001:pfg2014-07-254-5/+5
| | | | | | | | | Avoid possible cast degradation. Assign iov_len first, avoiding the cast to uio_resid (int in stdio) from degrading the value. Small cosmetical fix while here.
* MFC r268643:kevlo2014-07-241-1/+4
| | | | Document that listen(2) can fail with EDESTADDRREQ.
* MFC r268928:pfg2014-07-231-1/+1
| | | | | | Const-ify a character string. Obtained from: Apple Inc. (Libc 997.90.3)
* MFC r268644:pfg2014-07-213-22/+14
| | | | | | | | libc/stdlib: Minor cleanups to code originating in NetBSD Mostly ANSIfication and typos. Obtained from: NetBSD
* MFC r268642:pfg2014-07-212-19/+8
| | | | | | | | | | | | | | | | | | | | libc/gen: small updates to code originating at OpenBSD arc4random.c - CVS rev. 1.22 Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as ``-upper_bound % upper_bound''. Simplifies the code and makes it the same on both ILP32 and LP64 architectures, and also slightly faster on LP64 architectures by using a 32-bit remainder instead of a 64-bit remainder. - CVS rev. 1.23 Spacing readpassphrase.c -CVS rev. v 1.24 most obvious unsigned char casts for ctype Obtained from: OpenBSD
* MFC r268569:pfg2014-07-191-5/+3
| | | | | | | | strfmon: reduce unnecessary snprintf. No need for the snprintf/asprintf dance; use fixed width formats. Obtained from: NetBSD (CVS rev. 1.8)
* MFC r268467:kib2014-07-161-3/+9
| | | | Implement sysconf(_SC_GETGR_R_SIZE_MAX) and sysconf(_SC_GETPW_R_SIZE_MAX).
* MFC r267618:wblock2014-07-151-1/+1
| | | | Fix syntax error.
* MFC r268272:pfg2014-07-121-19/+10
| | | | | | | | | | | minor perf enhancement for UTF-8 Reduce some duplicate code. Reference: https://www.illumos.org/issues/628 Obtained from: Illumos
* MFC r268212:kib2014-07-101-46/+20
| | | | | Note that most errors are possible for all syscalls from utimes(2) family. Minor wording corrections.
* MFC r268393: [mdoc] Fix previous.pluknet2014-07-081-1/+1
|
* MFC 267756:ache2014-07-071-18/+12
| | | | | Merge intermediate OpenBSD v1.25 changes (almost identical to ours) to reduce diff and bump OpenBSD patch level to v1.26.
* MFC r267745, r268268:pfg2014-07-073-8/+22
| | | | | | | | | | | | getopt(3): recognize option:: as GNU extension for "optional options". Also ANSIfy a function declaration. While here update the OpenBSD patch level in getopt_long.c as we already have the corresponding change. Obtained from: NetBSD MFC after: 2 weeks
OpenPOWER on IntegriCloud