summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Remove extra FreeBSD tag.kib2010-08-241-1/+0
| | | | MFC after: 3 days
* Move the __stack_chk_fail_local@FBSD_1.0 compat symbol definition intokib2010-08-243-4/+22
| | | | | | | | | | | the separate .o for libc_pic.a. This prevents rtld from making the symbol global. Putting the stack_protector_compat.c into the public domain acknowledged by kan. Reviewed by: kan MFC after: 2 weeks
* Remove unused source.kib2010-08-241-57/+0
| | | | MFC after: 2 weeks
* The __hidden definition is provided by sys/cdefs.h.kib2010-08-241-4/+0
| | | | MFC after: 2 weeks
* Add wrapper for setcontext() and swapcontext(), the wrappersdavidxu2010-08-243-14/+55
| | | | unblock SIGCANCEL which is needed by thread cancellation.
* MFtbemd:imp2010-08-2317-56/+63
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* On shared object unload, in __cxa_finalize, call and clear all installedkib2010-08-238-4/+97
| | | | | | | | | | | | | | | | | | | | | | atexit and __cxa_atexit handlers that are either installed by unloaded dso, or points to the functions provided by the dso. Use _rtld_addr_phdr to locate segment information from the address of private variable belonging to the dso, supplied by crtstuff.c. Provide utility function __elf_phdr_match_addr to do the match of address against dso executable segment. Call back into libthr from __cxa_finalize using weak __pthread_cxa_finalize symbol to remove any atfork handler which function points into unloaded object. The rtld needs private __pthread_cxa_finalize symbol to not require resolution of the weak undefined symbol at initialization time. This cannot work, since rtld is relocated before sym_zero is set up. Idea by: kan Reviewed by: kan (previous version) MFC after: 3 weeks
* Introduce implementation-private rtld interface _rtld_addr_phdr, whichkib2010-08-232-0/+9
| | | | | | | | fills struct dl_phdr_info for the shared object that contains the specified address, if any. Idea and reviewed by: kan MFC after: 3 weeks
* Style.kib2010-08-232-3/+3
| | | | MFC after: 3 days
* UTFize my name.des2010-08-221-1/+1
|
* Don't link drti.o with libelf_pic.a. This means that all software withrpaulo2010-08-211-1/+0
| | | | | | | userland SDT probes must be linked with libelf explicitly. Requested by: kib Sponsored by: The FreeBSD Foundation
* Modify clang so that when TOOLS_PREFIX is defined we register therpaulo2010-08-211-0/+4
| | | | | | | | CLANG_PREFIX macro. This changes the default header search path when we are building clang as part of cross-tools. Submitted by: Dimitry Andric <dimitry at andric.com> Reviewed by: freebsd-current
* Install a PIC libelf. This will be needed by the DTrace runtimerpaulo2010-08-211-0/+1
| | | | | | instrumentation object (dtri.o). Sponsored by: The FreeBSD Foundation
* Reduce redundant code.davidxu2010-08-201-76/+21
| | | | Submitted by: kib
* In current implementation, thread cancellation is done in signal handler,davidxu2010-08-206-99/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which does not know what is the state of interrupted system call, for example, open() system call opened a file and the thread is still cancelled, result is descriptor leak, there are other problems which can cause resource leak or undeterminable side effect when a thread is cancelled. However, this is no longer true in new implementation. In defering mode, a thread is canceled if cancellation request is pending and later the thread enters a cancellation point, otherwise, a later pthread_cancel() just causes SIGCANCEL to be sent to the target thread, and causes target thread to abort system call, userland code in libthr then checks cancellation state, and cancels the thread if needed. For example, the cancellation point open(), the thread may be canceled at start, but later, if it opened a file descriptor, it is not canceled, this avoids file handle leak. Another example is read(), a thread may be canceled at start of the function, but later, if it read some bytes from a socket, the thread is not canceled, the caller then can decide if it should still enable cancelling or disable it and continue reading data until it thinks it has read all bytes of a packet, and keeps a protocol stream in health state, if user ignores partly reading of a packet without disabling cancellation, then second iteration of read loop cause the thread to be cancelled. An exception is that the close() cancellation point always closes a file handle despite whether the thread is cancelled or not. The old mechanism is still kept, for a functions which is not so easily to fix a cancellation problem, the rough mechanism is used. Reviewed by: kib@
* According to specification, function fcntl() is a cancellation point onlydavidxu2010-08-201-4/+11
| | | | when cmd argument is F_SETLKW.
* Use aux vector to get values for SSP canary, pagesize, pagesizes array,kib2010-08-1710-22/+217
| | | | | | | | | | | number of host CPUs and osreldate. This eliminates the last sysctl(2) calls from the dynamically linked image startup. No objections from: kan Tested by: marius (sparc64) MFC after: 1 month
* Tweak code a bit to be POSIX compatible, when a cancellation requestdavidxu2010-08-171-0/+2
| | | | | | | | | | | | is acted upon, or when a thread calls pthread_exit(), the thread first disables cancellation by setting its cancelability state to PTHREAD_CANCEL_DISABLE and its cancelability type to PTHREAD_CANCEL_DEFERRED. The cancelability state remains set to PTHREAD_CANCEL_DISABLE until the thread has terminated. It has no effect if a cancellation cleanup handler or thread-specific data destructor routine changes the cancelability state to PTHREAD_CANCEL_ENABLE.
* Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki whilejoel2010-08-1631-36/+37
| | | | | | translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
* In setusercontext(), do not apply user settings unless running as thedes2010-08-161-1/+1
| | | | | | | | user in question (usually but not necessarily because we were called with LOGIN_SETUSER). This plugs a hole where users could raise their resource limits and expand their CPU mask. MFC after: 3 weeks
* Old patch I had lying around: clean up and use stpcpy(3) instead ofdes2010-08-161-27/+34
| | | | sprintf(3).
* Further simplify the code, and update the manpage.des2010-08-152-26/+27
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
* Correct the return code from _dns_gethostby*() to correspondume2010-08-151-4/+20
| | | | | | | with h_errno. Obtained from: NetBSD MFC after: 2 weeks
* no-op commit to note that the example given in the previous commit isdes2010-08-151-1/+1
| | | | | | | | | a very bad one, since the shift does not actually overflow. This is a better example (assuming uint64_t = unsigned long long): ~0LLU >> 9 = 0x7fffffffffffffLLU ~0LLU >> 9 << 10 = 0xfffffffffffffc00LLU ~0LLU >> 9 << 10 >> 10 = 0x3fffffffffffffLLU
* Fix the overflow test. It is possible for the result of andes2010-08-151-1/+1
| | | | | | | overflowing shift to be larger than the original value, e.g. (uint64_t)1 << 53 = 0x20000000000000 ((uint64_t)1 << 53) << 10 = 0x8000000000000000
* Simplify expand_number() by combining the (unrolled) loop with thedes2010-08-142-27/+27
| | | | | | | switch. Since expand_number() does not accept negative numbers, switch from int64_t to uint64_t; this makes it easier to check for overflow. MFC after: 3 weeks
* - When there is no room for returning the result, nss backendume2010-08-1311-49/+109
| | | | | | | | | | have to return ERANGE and terminate with NS_RETURN. - When gethostbyname_r(3) and the friends end with an error, set errno to the value nss backend returns, and return errno value. PR: kern/131623 MFC after: 2 weeks
* Fix buildworld -DNO_CLEAN when using with Perforce, which marks files aswill2010-08-121-1/+1
| | | | | | | read-only by default, meaning files copied can't be overwritten next time. Reviewed by: imp Approved by: ken (mentor)
* Add translation support for section type SHT_SUNW_dof.kaiw2010-08-111-0/+2
| | | | | Submitted by: rpaulo MFC after: 2 weeks
* Several fixes for libproc:rpaulo2010-08-115-9/+25
| | | | | | | | o return the correct status in proc_wstatus() o proc_read takes a void * o correctly allocate the objs structure array Sponsored by: The FreeBSD Foundation
* Small style(9) fix: use tabs instead of spaces.ed2010-08-081-8/+8
|
* Remove unneeded functions from libcompat.ed2010-08-068-439/+4
| | | | | | Erwin fired up a ports build a couple of weeks ago and it seems the following functions are not used by any of the 20k ports we have, which makes me believe they don't have any purpose. Just remove them.
* Fix typos and spelling mistakes.joel2010-08-0613-17/+17
|
* Comment out IEEE Std 1003.1-2001 conformance proclaimed too early,ache2010-08-051-5/+5
| | | | | see problems described in the comment to: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/128933
* Fix typo.joel2010-08-031-1/+1
|
* Spelling fixes.joel2010-08-0313-19/+19
|
* Spelling fixes.joel2010-08-027-9/+9
|
* mdoc policing: use consistent section ordering, fix quotes and trailinguqs2010-08-021-15/+15
| | | | | | whitespace Approved by: rpaulo
* mdoc: remove unbalanced quotesuqs2010-08-022-6/+6
|
* mdoc: make sure to pass at least one argument to quotation macrosuqs2010-08-024-4/+4
|
* Disable all warnings when building gdtoa. This allows building libc withrpaulo2010-08-011-1/+1
| | | | | | | | | | clang. The general idea is that the vendor will not accept our compilation patches and so disabling the warnings is the best way to go as it makes future imports bearable. Submitted by: Dimitry Andric <dimitry at andric.com> Discussed with: das
* Use CFLAGS and LDFLAGS when compiling mkmagic. This ensures that all therpaulo2010-08-011-2/+1
| | | | | | | correct flags are being used (esp. NO_WERROR wrt clang). Submitted by: Dimitry Andric <dimitry at andric.com> Reviewed by: ru
* Revert SHLIB_MAJOR to 2.rpaulo2010-07-311-1/+1
| | | | | As discussed with kan@, since DTrace is the only consumer of libproc right now, there's no need for a major shlib bump.
* Build librtld_db.rpaulo2010-07-311-0/+2
| | | | Sponsored by: The FreeBSD Foundation
* Bump the shared library major version due to ABI conflicts.rpaulo2010-07-311-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* New version of libproc. Changes are:rpaulo2010-07-3116-76/+1316
| | | | | | | | | | | * breakpoint setup support * register query * symbol to address mapping and vice-versa * more misc utility functions based on their Solaris counterpart Also, I've written some test cases. Sponsored by: The FreeBSD Foundation
* Simplify the Makefile. The i386 and amd64 sections are equal.rpaulo2010-07-311-10/+1
| | | | Sponsored by: The FreeBSD Foundation
* libproc is going to be i386/amd64 only with the next update.rpaulo2010-07-311-1/+3
| | | | Sponsored by: The FreeBSD Foundation
* Import the librtld_db library. This is needed by userland DTrace.rpaulo2010-07-314-0/+581
| | | | | | | This is not yet enabled in the build because I also need to import a new version of libproc. Sponsored by: The FreeBSD Foundation
* Fix a couple of typos.uqs2010-07-301-1/+1
| | | | | | PR: docs/148891 Submitted by: olgeni MFC after: 1 week
OpenPOWER on IntegriCloud