aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Remove the advertising clause from the Regents of the University ofEd Maste2013-05-2810-50/+10
| | | | | | | California's license, per the letter dated July 22, 1999. Notes: svn path=/head/; revision=251067
* The getcontext() from the __fillcontextx() call in theKonstantin Belousov2013-05-2810-8/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week Notes: svn path=/head/; revision=251047
* Style(9)Steve Kargl2013-05-271-1/+1
| | | | | | | | Approved by: das (implicit) Reported by: jh Notes: svn path=/head/; revision=251046
* cap_rights_limit(2): CAP_ACCEPT also permits accept4(2).Jilles Tjoelker2013-05-271-1/+3
| | | | Notes: svn path=/head/; revision=251042
* * Update polynomial coefficients.Steve Kargl2013-05-271-33/+30
| | | | | | | | | | | * Use ENTERI/RETURNI to allow the use of FP_PE on i386 target. Reviewed by: das (and bde a long time ago) Approved by: das (mentor) Obtained from: bde (polynomial coefficients) Notes: svn path=/head/; revision=251041
* Partially apply the capitalization of the heading word of the sequenceKonstantin Belousov2013-05-271-3/+3
| | | | | | | | | | and fix typo. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=251040
* Fix some regressions caused by the switch from gcc to clang. The fixesDavid Schultz2013-05-2720-40/+53
| | | | | | | | | | | | | are workarounds for various symptoms of the problem described in clang bugs 3929, 8100, 8241, 10409, and 12958. The regression tests did their job: they failed, someone brought it up on the mailing lists, and then the issue got ignored for 6 months. Oops. There may still be some regressions for functions we don't have test coverage for yet. Notes: svn path=/head/; revision=251024
* Make the malloc(3) family of functions weak and make their non-weakMarcel Moolenaar2013-05-251-0/+11
| | | | | | | | | | | | | | | | | implementations visible for use by applications. The functions $F that are now weak symbols are: allocm, calloc, dallocm, free, malloc, malloc_usable_size, nallocm, posix_memalign, rallocm, realloc, sallocm The non-weak implementations of $F are exported as __$F. Submitted by: stevek@juniper.net Reviewed by: jasone@, kib@ Approved by: jasone@ (jemalloc) Obtained from: juniper Networks, Inc Notes: svn path=/head/; revision=250991
* sigreturn(2): Remove ancient compatibility warning about 4.2BSD.Jilles Tjoelker2013-05-251-4/+0
| | | | | | | The HISTORY subsection still says that sigreturn() was added in 4.3BSD. Notes: svn path=/head/; revision=250982
* Make some tiny improvements to iconv_open().Ed Schouten2013-05-251-21/+15
| | | | | | | | | | | | - Remove an unneeded variable. - Fix whitespace bugs. - Fix typoes in comment. - Improve string handling a bit. Don't handroll strstr() and don't terminate a strdup()'ed string. Instead, simply strndup() the part we need. Notes: svn path=/head/; revision=250981
* Only call free() on something we allocated.Ed Schouten2013-05-251-2/+2
| | | | | | | | | | If we were already provided a struct _citrus_iconv (e.g. through iconv_open_into()), we should not call free() in case io_init_context() fails. Instead, call it on the pointer of the allocated object, which will be NULL in case of iconv_open_into(). Notes: svn path=/head/; revision=250980
* Let iconv build on -HEAD properly.Ed Schouten2013-05-233-0/+3
| | | | | | | | | - Add NO_WMISSING_VARIABLE_DECLARATIONS where we use Yacc/Lex. - Add variable declarations where possible. - Add missing static keyword. Notes: svn path=/head/; revision=250938
* Update manpages for r250887.Ed Schouten2013-05-213-9/+3
| | | | | | | | | Remove the lists of unneeded header files. Requested by: eadler Notes: svn path=/head/; revision=250888
* Add <uchar.h>.Ed Schouten2013-05-219-52/+410
| | | | | | | | | | | | | | | The <uchar.h> header, part of C11, adds a small number of utility functions for 16/32-bit "universal" characters, which may or may not be UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight wrappers around wcrtomb() and mbrtowc(). While there, also add (non-yet-standard) _l functions, similar to the ones we already have for the other locale-dependent functions. Reviewed by: theraven Notes: svn path=/head/; revision=250883
* Add a makefle that recurses into the right architecture-specificMarcel Moolenaar2013-05-211-0/+10
| | | | | | | | | | sub-directory. This to allow simpler logic outside of the csu directory. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=250863
* Update the setfib man page to reflect recent changes.Julian Elischer2013-05-201-3/+6
| | | | Notes: svn path=/head/; revision=250831
* popen(): Add 'e' mode character to set close-on-exec on the new fd.Jilles Tjoelker2013-05-202-10/+27
| | | | | | | | | | | | | | | | | If 'e' is used, the kernel must support the recently added pipe2() system call. The use of pipe2() with O_CLOEXEC also fixes race conditions between concurrent popen() calls from different threads, even if the close-on-exec flag on the fd of the returned FILE is later cleared (because popen() closes all file descriptors from earlier popen() calls in the child process). Therefore, this approach should be used in all cases when pipe2() can be assumed present. The old version of popen() rejects "re" and "we" but treats "r+e" like "r+". Notes: svn path=/head/; revision=250827
* Return one-based key so that user can check if the key is ever allocatedDavid Xu2013-05-161-4/+7
| | | | | | | | | in the first place. Initial patch submitted by: phk Notes: svn path=/head/; revision=250691
* Fix a typo: It should be "strtoll" and not "stroll".Hiren Panchasara2013-05-141-3/+3
| | | | | | | | | | PR: 178642 Reported by: Michael Galassi (michaelgalassi@gmail.com) Approved by: sbruno (mentor) MFC after: 1 week Notes: svn path=/head/; revision=250639
* Use an ugly hack to get around bootstrapping problems when buildingDimitry Andric2013-05-131-0/+5
| | | | | | | | | | | | | | | | | | clang on head between r239347 and r245428. The former revision introduced CLOCK_PROCESS_CPUTIME_ID as a clock id for the clock_gettime() function and friends, but it was only added in <sys/time.h>, not in <time.h>. Any program including <time.h> would therefore not be able to use CLOCK_PROCESS_CPUTIME_ID, even though the value of _POSIX_CPUTIME indicates its existence. The latter revision synchronized the defines again. Work around this problem by defining the id on the command line for the particular .cpp file that needs it. If the id ever changes value, this hack will need to be updated. Notes: svn path=/head/; revision=250616
* mdoc sweep.Joel Dahl2013-05-124-6/+12
| | | | Notes: svn path=/head/; revision=250582
* Fix several typosEitan Adler2013-05-121-1/+1
| | | | | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days Notes: svn path=/head/; revision=250576
* Typo.Sergey Kandaurov2013-05-121-1/+1
| | | | Notes: svn path=/head/; revision=250554
* posix_spawn_file_actions_adddup2(3): Document difference with dup2().Jilles Tjoelker2013-05-091-2/+23
| | | | | | | | | | | The ability to clear a file descriptor's close-on-exec flag via posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue #411. MFC after: 1 week Notes: svn path=/head/; revision=250421
* posix_spawn_file_actions_addopen(3): Correct error for bad file descriptor.Jilles Tjoelker2013-05-091-2/+2
| | | | | | | | | | | As per POSIX.1-2008, posix_spawn_file_actions_add* return [EBADF] if a file descriptor is negative, not [EINVAL]. The bug was only in the manual page; the code is correct. MFC after: 1 week Notes: svn path=/head/; revision=250412
* wordexp(): Simplify code by deferring work to sh.Jilles Tjoelker2013-05-091-13/+3
| | | | Notes: svn path=/head/; revision=250406
* Fix return value for setcontext and swapcontext.David Xu2013-05-091-4/+8
| | | | Notes: svn path=/head/; revision=250402
* Make errbuf optional, so if a caller is not interested in an errorMikolaj Golub2013-05-081-14/+30
| | | | | | | | | message she can pass NULL (procstat(1) already does this). MFC after: 2 weeks Notes: svn path=/head/; revision=250378
* Add libusb_get_port_path wrapperEd Maste2013-05-083-1/+18
| | | | | | | | | | This follows the libusbx API reference at http://libusbx.sourceforge.net/api-1.0/group__dev.html Reviewed by: hselasky@ Notes: svn path=/head/; revision=250342
* Constify libusb_get_pollfds returnEd Maste2013-05-072-3/+3
| | | | | | | | | | | | | | | | | | The correct return type, per our libusb(3) man page and the libusb.org and libusbx projects (whose interface we intend to follow for our libusb), is const struct libusb_pollfd **. Unfortunately the doxygen-generated libusbx API documentation[1] omits[2] the const for some reason. [1] http://libusbx.sourceforge.net/api-1.0/group__poll.html#gab1a72869a926552b27a6c667695df3a2 [2] http://sourceforge.net/mailarchive/forum.php?thread_name=497D10BE.8090007%40n-dimensional.de&forum_name=libusb-devel Reviewed by: hselasky@ Notes: svn path=/head/; revision=250335
* MFV: Update zlib to 1.2.8.Xin LI2013-05-0525-139/+328
|\ | | | | | | | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=250261
* | POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos.Sergey Kandaurov2013-05-043-1/+11
| | | | | | | | Notes: svn path=/head/; revision=250250
* | Document that the return type is different from 1003.1-2008.Sergey Kandaurov2013-05-041-2/+9
| | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=250245
* | mdoc: missing comma in .Dd macro.Sergey Kandaurov2013-05-045-5/+5
| | | | | | | | Notes: svn path=/head/; revision=250244
* | Add entry for errno ECAPMODE.Sergey Kandaurov2013-05-041-0/+2
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=250234
* | Bump date.Sergey Kandaurov2013-05-041-1/+1
| | | | | | | | Notes: svn path=/head/; revision=250233
* | libkvm: Make second /dev/null file descriptor close-on-exec as well.Jilles Tjoelker2013-05-041-1/+1
| | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=250231
* | libkvm: Use O_CLOEXEC instead of separate fcntl(F_SETFD) call.Jilles Tjoelker2013-05-041-15/+4
| | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=250230
* | Improve compatibility with recent flex from flex.sourceforge.net.Jung-uk Kim2013-05-032-5/+4
| | | | | | | | Notes: svn path=/head/; revision=250227
* | Similar to 233760 and 236717, export some more useful info about theJohn Baldwin2013-05-034-1/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel-based POSIX semaphore descriptors to userland via procstat(1) and fstat(1): - Change sem file descriptors to track the pathname they are associated with and add a ksem_info() method to copy the path out to a caller-supplied buffer. - Use the fo_stat() method of shared memory objects and ksem_info() to export the path, mode, and value of a semaphore via struct kinfo_file. - Add a struct semstat to the libprocstat(3) interface along with a procstat_get_sem_info() to export the mode and value of a semaphore. - Teach fstat about semaphores and to display their path, mode, and value. MFC after: 2 weeks Notes: svn path=/head/; revision=250223
* | Allow building clang on older FreeBSD releases, where log2() does notDimitry Andric2013-05-031-0/+5
| | | | | | | | | | | | | | | | | | | | exist yet. With this change, I have verified that building head on 8.1-RELEASE works. Noticed by: Ryan Stone <rysto32@gmail.com> Notes: svn path=/head/; revision=250217
* | Also, add a missing period.Sergey Kandaurov2013-05-033-3/+3
| | | | | | | | Notes: svn path=/head/; revision=250211
* | Remove an extra comma.Sergey Kandaurov2013-05-033-3/+3
| | | | | | | | Notes: svn path=/head/; revision=250210
* | Remove the STANDARDS section.Sergey Kandaurov2013-05-031-4/+1
| | | | | | | | | | | | | | | | | | querylocale is not part of IEEE Std 1003.1-2008. MFC after: 3 days Notes: svn path=/head/; revision=250209
* | Always install pmc.foo(3) manpages.Ulrich Spörlein2013-05-031-12/+8
| | | | | | | | | | | | | | | | | | | | | | There is no point in hiding, e.g. pmc.xscale(3) from a developer running on amd64, when the target arch in question will probably never have manual pages installed at all. Reviewed by: sbruno, hiren Notes: svn path=/head/; revision=250203
* | Add new USB API to get the port path of a USB device.Hans Petter Selasky2013-05-036-1/+45
| | | | | | | | | | | | | | | | MFC after: 2 weeks Requested by: emaste @ Notes: svn path=/head/; revision=250201
* | accept(2), pipe(2): Fix .Dd.Jilles Tjoelker2013-05-012-2/+2
| | | | | | | | Notes: svn path=/head/; revision=250161
* | Add pipe2() system call.Jilles Tjoelker2013-05-013-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib Notes: svn path=/head/; revision=250159
* | Add accept4() system call.Jilles Tjoelker2013-05-015-3/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The accept4() function, compared to accept(), allows setting the new file descriptor atomically close-on-exec and explicitly controlling the non-blocking status on the new socket. (Note that the latter point means that accept() is not equivalent to any form of accept4().) The linuxulator's accept4 implementation leaves a race window where the new file descriptor is not close-on-exec because it calls sys_accept(). This implementation leaves no such race window (by using falloc() flags). The linuxulator could be fixed and simplified by using the new code. Like accept(), accept4() is async-signal-safe, a cancellation point and permitted in capability mode. Notes: svn path=/head/; revision=250154
* | procstat_getpathname: for kvm method, instead of returning the errorMikolaj Golub2013-05-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | that the method is not supported, return an empty string. This looks more handy for callers like procstat(1), which will not abort after the failed call and still output some useful information. MFC after: 3 weeks Notes: svn path=/head/; revision=250147