aboutsummaryrefslogtreecommitdiff
path: root/lib/libproc/proc_util.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-261-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* libproc: Add support for some proc_attach() flags.Mark Johnston2016-12-061-4/+8
| | | | | | | | | | This change adds some handling for the equivalent of Solaris' PGRAB_* flags. In particular, support for PGRAB_RDONLY is needed to avoid a nasty deadlock: dtrace(1) may otherwise stop the master process for its pseudo-terminal and end up blocking while writing to standard output. Notes: svn path=/head/; revision=309597
* libproc: Make proc_getpid() an accessor for struct proc_handle.Mark Johnston2016-12-061-20/+13
| | | | | | | | | This allows librtld_db to fetch the PID from a handle without calling into libproc. Together with r303531, this means that librtld_db no longer references symbols from libproc. Notes: svn path=/head/; revision=309592
* Fix style bugs and remove trailing whitespace in libproc and librtld_db.Mark Johnston2016-12-061-5/+10
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=309591
* libproc: Add proc_getmodel().Mark Johnston2016-07-301-0/+10
| | | | | | | | | | | This is used by libdtrace to determine the data model of target processes. This allows for the creation of pid provider probes in 32-bit processes on amd64. MFC after: 1 month Notes: svn path=/head/; revision=303533
* If the traced process stops because it received a signal, libproc needsMark Johnston2014-05-041-9/+15
| | | | | | | | | to ensure that the signal is forwarded when proc_continue() is called. MFC after: 3 weeks Notes: svn path=/head/; revision=265308
* Revert r257248 and fix the problem in a way that doesn't violate style(9).Mark Johnston2013-10-291-2/+1
| | | | | | | Suggested by: jmg Notes: svn path=/head/; revision=257298
* Fix the build with gcc.Mark Johnston2013-10-281-1/+2
| | | | Notes: svn path=/head/; revision=257248
* Clean up the debug printing in libproc a bit. In particular:Mark Johnston2013-10-271-1/+1
| | | | | | | | | * Don't print any error messages to stderr unless DEBUG is defined. * Add a DPRINTFX macro for use when errno isn't set. * Print the error string from libelf when appropriate. Notes: svn path=/head/; revision=257222
* Ignore EINTR when calling waitpid.Rui Paulo2010-09-181-1/+2
| | | | Notes: svn path=/head/; revision=212831
* Several fixes for libproc:Rui Paulo2010-08-111-4/+7
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=211184
* New version of libproc. Changes are:Rui Paulo2010-07-311-26/+113
| | | | | | | | | | | | | | * 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 Notes: svn path=/head/; revision=210688
* Add a process library with some stubs that the DTrace client needs.John Birrell2008-05-221-0/+133
These will be fleshed out as part of the DTrace userland tracing development. For now, the kernel tracing part of DTrace requires minimal functionality for this library. The API for this library is deliberately different from the libproc in OpenSolaris due to licensing restrictions. Notes: svn path=/head/; revision=179185