summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Provide an example to the kqueue man page, showingbcr2016-05-011-1/+52
| | | | | | | | | | | | | a basic usage example. Although it is an untypical example for the use of kqueue, it is better than nothing and should get people started. PR: 196844 Submitted by: fernando.apesteguia@gmail.com Reviewed by: kib Approved by: kib MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D6082
* libc: spelling fixes.pfg2016-04-3034-43/+43
| | | | Mostly on comments.
* libc: make more use of the howmany() macro when available.pfg2016-04-262-3/+2
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
* regex: prevent two improbable signed integer overflows.pfg2016-04-231-2/+2
| | | | | | | | | | | In matcher() we used an integer to index nsub of type size_t. In print() we used an integer to index nstates of type sopno, typedef'd long. In both cases the indexes never take negative values. Match the types to avoid any error. MFC after: 5 days
* Restore the original ascii.c from prior to r290494bapt2016-04-211-13/+10
| | | | | | | | It was doing the right thing, there was no need to "fail" to reinvent it from none.c Pointy hat: bapt Submitted by: ache
* Check the returned value of memchr(3) before using itbapt2016-04-201-1/+4
| | | | | Reported by: Coverity CID: 1338530
* Minor indentation issue.pfg2016-04-201-2/+1
|
* libc: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-203-6/+6
| | | | | rounddown2 tends to produce longer lines than the original code but still it makes the code more readable.
* Fix double fclose of `fp1` when freopen failsngie2016-04-201-1/+0
| | | | | | | | | | | | freopen handles closing file descriptors on error, with the exception of fdopen'ed descriptors, so closing an already fclose'd file descriptor is incorrect CID: 1338525 Differential Revision: https://reviews.freebsd.org/D6013 MFC after: 2 weeks Reported by: Coverity Sponsored by: EMC / Isilon Storage Division
* Make sure fmemopen succeeds in :test_append_binary_pos before calling ftellngie2016-04-191-0/+2
| | | | | | | | | | | on the FILE object This fixes potential null pointer dereferences on failure CID: 1254952 MFC after: 2 weeks Reported by: Coverity Sponsored by: EMC / Isilon Storage Division
* Remove trailing whitespace and use `nitems(mib)` instead of `2` whenngie2016-04-191-2/+2
| | | | | | | calling sysctl(3) MFC after: 3 days Sponsored by: EMC / Isilon Storage Division
* libc: do not include <sys/types.h> where <sys/param.h> was already includedavos2016-04-1839-42/+3
| | | | | | According to style(9): > normally, include <sys/types.h> OR <sys/param.h>, but not both. (<sys/param.h> already includes <sys/types.h> when LOCORE is not defined).
* Re-use our roundup2() macro instead of reinventing the wheel.pfg2016-04-181-6/+4
| | | | Obtained from: DragonflyBSD
* Fixed indentation, minor style.pluknet2016-04-181-12/+12
|
* Fix markup on "\n" in printf so it renders correctly.wblock2016-04-171-4/+4
| | | | | | PR: 208852 Submitted by: coder@tuxfamily.org MFC after: 1 week
* libc: make some more use of the nitems() macro.pfg2016-04-1610-26/+22
| | | | | | | | We have an nitems() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Given that it is available already without adding additional headers and other parts of libc already use it, extend a bit more its use.
* MFHgjb2016-04-163-0/+3
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * arm64 libc: hide .cerror, .curbrk, .minbrk for WITHOUT_SYMVERemaste2016-04-143-0/+3
| | | | | | | | | | | | | | | | | | | | When symver is in use these are hidden because they're not listed in the Symbol.map. Add an explicit .hidden so they are also hidden in the WITHOUT_SYMVER case. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5775
* | MFHgjb2016-04-131-1/+1
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Remove PS_STRINGS fallback from setproctitleemaste2016-04-121-1/+1
| | | | | | | | | | | | | | | | In r103767 the kern.ps_strings sysctl was added as the preferred way to locate the ps_strings struct and is available in any FreeBSD release supported within the last decade. Reviewed by: kib
| * libc: cleanup unnecessary semicolons (part 2).pfg2016-04-112-2/+2
| | | | | | | | Found with devel/coccinelle.
| * libc: cleanup unnecessary semicolons.pfg2016-04-111-7/+7
| | | | | | | | Found with devel/coccinelle.
* | MFHgjb2016-04-123-9/+9
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-04-1126-53/+63
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * libc: replace 0 with NULL for pointers.pfg2016-04-1022-52/+49
| | | | | | | | | | | | | | | | | | While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine)
| * Follow-up r295924: Only sync hash-based db files open for writing when closing.bdrewery2016-04-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | This fixes a major performance regression when reading db files such as the pw database during a 'pkg install'. MFC after: 1 week Tested by: bapt Reviewed by: bapt Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5868
| * Revert a change that sneeked with 297619andrew2016-04-061-3/+1
| |
| * Disable support for compat syscalls on arm64. These symbols were neverandrew2016-04-065-1/+15
| | | | | | | | | | | | | | shipped since arm64 exists only on 11+. Submitted by: brooks Reviewed by: emaste, imp
* | MFHgjb2016-04-0426-47/+39
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * SJIS encoding don't have single byte characters >= 224ache2016-04-041-1/+1
| | | | | | | | MFC after: 1 week
| * EUC-type encodings don't have single byte characters >= 128ache2016-04-041-3/+3
| | | | | | | | | | | | This change should not be MFCed until new collate will be MFCed first, because our old EUC tables have some hacks for missing codesets.
| * Document KTRFAC_FAULT and KTRFAC_FAULTEND.brooks2016-03-311-1/+3
| | | | | | | | | | | | Obtained from: CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c) MFC after: 1 week Sponsored by: DARPA, AFRL
| * WITHOUT_TOOLCHAIN: Skip building of h_raw.bdrewery2016-03-311-1/+1
| | | | | | | | | | | | | | -fsanitize does not seem to work when a --sysroot is specified and there is no <sysroot>/usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-*.a. Sponsored by: EMC / Isilon Storage Division
| * WITHOUT_TOOLCHAIN: Fix build of rtld.bdrewery2016-03-311-0/+3
| | | | | | | | | | | | | | | | | | | | MK_TOOLCHAIN==no disables building and installing of pic archives. c_pic.a is still needed for rtld though so force it to build in lib/libc and link directly to the objdir version of it for rtld. Somehow this has been broken since r148725. Sponsored by: EMC / Isilon Storage Division
| * libc: stop exporting cerroremaste2016-03-305-5/+0
| | | | | | | | | | | | | | | | | | | | i386 stopped exporting .cerror in r240152, and likewise for amd64 in r240178. It is not used by other libraries on any platform, so apply the same change to the remaining architectures. Reviewed by: jhibbits, jilles Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5774
| * freopen(3): prevent uninitialized errno.pfg2016-03-301-1/+0
| | | | | | | | | | | | | | Revert completley r297408 (and r297407): this ends up touching errno, which we are not allowed to do. Pointed out by: ache, bde
| * freopen(3): prevent uninitialized errno.pfg2016-03-301-2/+2
| | | | | | | | | | | | | | | | Revert r297407 and redo it cleanly. Pointed out by: Jukka A. Ukkonen CID: 1018720 MFC after: 1 week
| * freopen(3): prevent uninitialized errno.pfg2016-03-301-1/+2
| | | | | | | | | | | | | | The case doesn't look very likely but clean the possibility nevertheless CID: 1018720 MFC after: 1 week
| * Fix bunch of .Xrs.trasz2016-03-282-3/+3
| | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
| * Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.bdrewery2016-03-262-2/+0
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
| * libc: stop exporting curbrk and minbrk in the private namespaceemaste2016-03-249-18/+0
| | | | | | | | | | | | | | | | | | They are not used anywhere else in the base system and are an internal implementation detail that does not need to be exposed. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5728
| * Fully handle size_t lengths in AIO requests.jhb2016-03-212-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, update the return types of aio_return() and aio_waitcomplete() to ssize_t. POSIX requires aio_return() to return a ssize_t so that it can represent all return values from read() and write(). aio_waitcomplete() should use ssize_t for the same reason. aio_return() has used ssize_t in <aio.h> since r31620 but the manpage and system call entry were not updated. aio_waitcomplete() has always returned int. Note that this does not require new system call stubs as this is effectively only an API change in how the compiler interprets the return value. Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. aio_read/write should now honor the same length limits as normal read/write. Third, use longs instead of ints in the aio_return() and aio_waitcomplete() system call functions so that the 64-bit size_t in the in-kernel aiocb isn't truncated to 32-bits before being copied out to userland or being returned. Finally, a simple test has been added to verify the bounds checking on the maximum read size from a file.
| * Use the right argumant namejulian2016-03-181-1/+1
| | | | | | | | | | MFC after: 1 week Sponsored by: Panzura inc
| * libc: don't build compat functions if building WITHOUT_SYMVERemaste2016-03-155-8/+20
| | | | | | | | | | | | | | WITHOUT_SYMVER necessarily implies building a system without symver backwards compatability. Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-03-141-9/+0
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Remove Symbol.map entries for old AIO system calls for FreeBSD 6 compat.jhb2016-03-121-9/+0
| | | | | | | | | | | | | | | | | | | | | | These entries should have never been present since they only exist for compat with FreeBSD 6.x (and older) binaries. This was missed in r296572. Technically this breaks the ABI by removing versioned symbols. However, no binaries should be linked against these symbols. No release has shipped with a header that contained a prototype for these functions. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5615
* | MFHgjb2016-03-1029-2/+516
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-0925-0/+511
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
| * Fix and connect setjmp test.bdrewery2016-03-091-0/+1
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
| * Fix spelling of MAXNAMLEN.trasz2016-03-091-2/+2
| | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud