summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* regex(3): Add support for \< and \> word delimiterspfg2014-06-302-2/+25
| | | | | | | | | | | | | | | | | | 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 after: 1 month
* Fix build with WITHOUT_INET6.ume2014-06-261-0/+2
| | | | | Spotted by: bf MFC after: 1 week
* - Exclude loopback address rather than loopback interface.ume2014-06-261-13/+27
| | | | | | | | | | | - style(9) TODO: When AI_ADDRCONFIG is specified, getaddrinfo() can be quite slow for system with many interfaces. We should have some kernel sysctls to report IPv4/IPv6 status. Spotted by: melifaro MFC after: 1 week
* Document EINVAL as per POSIX.pluknet2014-06-262-2/+10
| | | | | | | | This also follows r124335-r124336, r225827. PR: 191382 MFC after: 1 week Sponsored by: Nginx, Inc.
* Catch up with many years of changes:wollman2014-06-241-13/+50
| | | | | | | | | | | | | | | | | | | o Document PF_LOCAL as being an alias for PF_UNIX o Document POSIX standardization of this interface using AF_* constants rather than PF_* constants, and note the three particular families which POSIX standardizes. o Note anticipated POSIX standardization of SOCK_CLOEXEC. o Delete from listing protocol families that FreeBSD doesn't support (in some cases, like PF_PUP, has never supported). o Add to listing some current protocol families that have been introduced in the last decade or so. o Document the correspondence of PF_* and AF_* constants. We should probably change the documentation to make the AF_* constants primary, but this commit does not do so. Reviewed by: kevlo@ MFC after: 1 month
* mdoc: remove superfluous paragraph macros.joel2014-06-231-2/+0
|
* Exclude IPv4 address from doing longest match.ume2014-06-231-1/+2
| | | | | | It prevented DNS based load balancing. MFC after: 1 week
* use .Mt to mark up email addresses consistently (part4)bapt2014-06-2387-111/+105
| | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* Merge intermediate OpenBSD v1.25 changes (almost identical to ours)ache2014-06-221-18/+12
| | | | | | to reduce diff and bump OpenBSD patch level to v1.26. MFC after: 2 weeks
* getopt(3): recognize option:: as GNU extension for "optional options".pfg2014-06-223-8/+22
| | | | | | | | | | 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
* Revert r267675:pfg2014-06-211-6/+6
| | | | | | | | The code doesn't really benefit of using reallocf() in this case. Also, the realloc() results being assigned temporary variable which makes blind replacement with reallocf() mostly useless. Pointed out by: stefanf, bde
* regex: Make use of reallocf().pfg2014-06-201-6/+6
| | | | | | | | | | | | Use of reallocf is useful in libraries as we are not certain the application will exit after NULL. This somewhat reduces portability but if since you are building this as part of libc it is likely you have our non-standard reallocf(3) already. Reviewed by: ache MFC after: 5 days
* Use SOCK_CLOEXEC.ume2014-06-191-1/+1
| | | | MFC after: 1 week
* Add MAP_EXCL flag for mmap(2). It should be combined with MAP_FIXED,kib2014-06-191-6/+27
| | | | | | | | | | | and prevents the request from deleting existing mappings in the region, failing instead. Reviewed by: alc Discussed with: jhb Tested by: markj, pho (previous version, as part of the bigger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* The time come to remove the wrapper, most likely, but tidy up it codekib2014-06-191-11/+6
| | | | | | | | instead for now. Remove spurious blank line, use C89 definition, wrap long line. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* strptime: add support for %t and %npfg2014-06-181-38/+20
| | | | | | | | | | | | | | | Posix strptime() requires support for %t and %n, which were added to the illumos port. Curiously we were skipping white spaces by default in most other cases making %t meaningless. We now skip spaces in the case of the %e specifier as strftime(3) explicitly adds a space for the single digit case. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html Obtained from: Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2) MFC after: 3 weeks
* Fix syntax error.wblock2014-06-181-1/+1
| | | | | | PR: 191131 Submitted by: dan.mcgregor@usask.ca MFC after: 1 week
* Retooling addrconfig() to exclude addresses on loopback interfacesume2014-06-181-29/+62
| | | | | | | | | | | | | when looking for configured addresses. This change is based upon the code from the submitter, and made following changes: - Exclude addresses assigned on interfaces which are down, like NetBSD does. - Exclude addresses assigned on interfaces which are ifdisabled. PR: 190824 Submitted by: Justin McOmie MFC after: 1 week
* stdtime: style(9) fixes.pfg2014-06-183-184/+186
| | | | | Obtained from: illumos MFC after: 5 days
* Update license to strptime(3) implementation.pfg2014-06-161-28/+5
| | | | | | | | | | | | | | | | | | | | Our strptime(3) implementation was the base for the illumos implementation and after contacting the author, Kevin Rudy stated the code is under a 2-Clause BSD License [1] After reviewing our local changes to the file in question, the FreeBSD Foundation has agreed that their contributions to this file are not required to carry clause 3 or 4 so the file can be relicensed as in Illumos [2]. References: [1] https://www.illumos.org/issues/357 [2] Illumos Revision: 13222:02526851ba75 Approved: core (jhb) Approved: FreeBSD Foundation (emaste) MFC after: 4 days
* iconv_open: initialise ci_ilseq_invalid field of _citrus_iconv_sharedtijl2014-06-131-2/+3
| | | | | | struct after allocation with malloc. iconvlist: reduce a memory leak by copying strings only once.
* Replace malloc+memset with calloc.tijl2014-06-132-5/+2
|
* siglongjmp(): Preserve floating point exception flags on i386 and amd64.jilles2014-06-092-2/+0
| | | | | | | | | | Per POSIX, siglongjmp() shall be equivalent to longjmp() except that it must match sigsetjmp() instead of setjmp() and except for the effect on the signal mask. Therefore, it should preserve the floating point exception flags. This was fixed for longjmp() and _longjmp() in r180080 and r180081 for amd64 and i386 respectively.
* - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX).gahr2014-06-022-8/+18
| | | | | | | | | | 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
* Minor mdoc fixbjk2014-05-301-1/+1
| | | | | Submitted by: hrs Approved by: hrs (mentor, implicit)
* Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance.pfg2014-05-301-2/+2
| | | | | | | | | | | | POSIX.1-2008 specifies that those two functions should be declared by including <strings.h>, not <string.h> (the latter only has strcoll_l() and strxfrm_l()): http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html Obtained from: DragonFlyBSD Reviewed by: theraven MFC after: 2 weeks
* mdoc: add missing paragraph macro.pluknet2014-05-291-0/+1
|
* Emphasis on 'do not' and 'complement' in the strcspn(3)allanjude2014-05-271-5/+6
| | | | | | Replace literal parentheses with .Po/.Pc Approved by: wblock (mentor)
* Merge strcspn.3 into strspn.3 and clarify the explaination of what they doallanjude2014-05-253-98/+37
| | | | | | | Detach strcspn.3 from the build Add strcspn.3 to MLINKS do it will be symlinked to strspn.3 Approved by: eadler (mentor), bcr (mentor)
* Correct documentation of the limit on how much memory can be mlock()edbjk2014-05-171-7/+14
| | | | | | | | | vm.max_wired is a system-wide limit, not per-process. Reword the section to make this more clear. PR: docs/189214 Submitted by: Lawrence Chen (original text) Approved by: hrs (mentor)
* Invalidate the cache for the named posix semaphore when opened andkib2014-05-101-29/+36
| | | | | | | | | | | | | | | | | | | actual file storing the semaphore object is different from the file created on the first open. Store the file st_dev and st_ino members of the struct stat in the semaphore structure on open, and compare them with the attributes of the opened file to detect unlink and re-creation. This fixes an issue of sem_unlink(3) failing to flush the named entry in the semaphore list for the current or remote process, making sem_unlink(3) not correctly operating if the unlinked semaphore is still opened. Reported by: Joris Giovannangeli <joris@giovannangeli.fr> PR: standards/189353 Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Style.kib2014-05-101-2/+2
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* msync(2) must return ENOMEM and not EINVAL when the address is outside thepho2014-05-071-5/+7
| | | | | | | | | | | allowed range or when one or more pages are not mapped. This according to The Open Group Base Specifications Issue 7. Discussed with: attilio, Bruce Evans Reviewed by: alc, Garrett Cooper Reported by: ATF MFC after: 2 weeks Sponsored by: EMC / Isilon storage division
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| | | | from the latter.
* Revert r265367:pfg2014-05-051-1/+1
| | | | | | | | Use of calloc instead of malloc in regex (from OpenBSD). In this case the change makes no sense since we are using realloc() later. Reported by: ache
* regex: Use calloc instead of malloc.pfg2014-05-051-1/+1
| | | | | | | Mostly to reduce differences with OpenBSD. Obtained from: OpenBSD (CVS rev. 1.17) MFC after: 3 days
* Properly free resources in case of error.brueffer2014-05-021-8/+6
| | | | | | CID: 1007032 Found with: Coverity Prevent(tm) MFC after: 2 weeks
* regex: Remove some unreachable breaks.pfg2014-05-012-7/+1
| | | | | | | | | This is based on a much bigger cleanup done in Illumos. Reference: https://www.illumos.org/issues/2077 MFC after: 1 week
* citrus: Avoid invalid code points.pfg2014-05-011-2/+1
| | | | | | | | | | | | | From the OpenBSD log: The UTF-8 decoder should not accept byte sequences which decode to unicode code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 http://unicode.org/faq/utf_bom.html#utf8-4 Reported by: Stefan Sperling Obtained from: OpenBSD MFC after: 5 days
* citrus: Avoid invalid code points.pfg2014-04-291-0/+8
| | | | | | | | | | | | | From the OpenBSD log: The UTF-8 decoder should not accept byte sequences which decode to unicode code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 http://unicode.org/faq/utf_bom.html#utf8-4 Reported by: Stefan Sperling Obtained from: OpenBSD MFC after: 5 days
* Set the new floating point exception mask correctlyandrew2014-04-281-1/+1
| | | | Submitted by: Keith White <kwhite@site.uottawa.ca>
* libc/stdio: Fail fdopen() on an execute-only fd.jilles2014-04-212-3/+5
| | | | | | | | | An execute-only fd (opened with O_EXEC) allows neither read() nor write() and is therefore incompatible with all stdio modes. Therefore, the [EINVAL] error applies. Also adjust the similar check in freopen() with a NULL path, even though this checks an fd which is already from a FILE.
* Rename the fp{get,set}* files so they no longer conflict with the softfloatandrew2014-04-217-2/+2
| | | | | version of these files. Keep them within this directory so they can be used to implement the armv6 version of these functions.
* Add the deprecated fp{get,set}* functions, a few ports use them.andrew2014-04-207-0/+304
|
* Correct sorting.brueffer2014-04-151-1/+1
|
* Mention Capsicum.brueffer2014-04-151-1/+7
| | | | MFC after: 1 week
* realpath(): Properly fail "." or ".." components after non-directories.jilles2014-04-131-20/+6
| | | | | | | | | | | | | If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..", it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as they should. Also, put the check for non-directories after lstatting the previous component instead of when the empty component (consecutive or trailing slashes) is detected, saving an lstat() call and some lines of code. PR: kern/82980 MFC after: 2 weeks
* Fix table alignment. EVFILT_PROCDESC is longer than the existing filters.ed2014-04-071-1/+1
|
* Implement kqueue(2) for procdesc(4).ed2014-04-072-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | kqueue(2) already supports EVFILT_PROC. Add an EVFILT_PROCDESC that behaves the same, but operates on a procdesc(4) instead. Only implement NOTE_EXIT for now. The nice thing about NOTE_EXIT is that it also returns the exit status of the process, meaning that we can now obtain this value, even if pdwait4(2) is still unimplemented. Notes: - Simply reuse EVFILT_NETDEV for EVFILT_PROCDESC. As both of these will be used on totally different descriptor types, this should not clash. - Let procdesc_kqops_event() reuse the same structure as filt_proc(). The only difference is that procdesc_kqops_event() should also be able to deal with the case where the process was already terminated after registration. Simply test this when hint == 0. - Fix some style(9) issues in filt_proc() to keep it consistent with the newly added procdesc_kqops_event(). - Save the exit status of the process in pd->pd_xstat, as we cannot pick up the proctree_lock from within procdesc_kqops_event(). Discussed on: arch@ Reviewed by: kib@
* Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks.kevlo2014-04-071-0/+5
| | | | | | | | Tested with vlc and a test suite [1]. [1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz Reviewed by: jhb, glebius, adrian
OpenPOWER on IntegriCloud