aboutsummaryrefslogtreecommitdiff
path: root/lib/libproc
Commit message (Collapse)AuthorAgeFilesLines
* libproc: link against libctf if MK_CTF != no instead of MK_CDDL != noEnji Cooper2026-07-161-1/+1
| | | | | | | | | | | | | | | Logic prior to this change would incorrectly try linking when MK_CDDL != no, instead of MK_CTF != no, which could result in the library and the tests being broken if/when MK_CTF == no and MK_CDDL != no (an uncommon, but possible combination with today's build knobs). This change updates the conditional to correctly track the value of MK_CTF, which in turn is properly toggled to no if/when MK_CDDL == no as it's a dependent build knob. This [niche] build bug has been present in FreeBSD since 2014. MFC after: 1 week
* Use ZFSTOP more broadlyJohn Baldwin2025-11-241-4/+4
| | | | | | Reviewed by: brooks Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D53791
* zfs: unbreak gcc builds after openzfs/zfs@e63d026b9Martin Matuska2025-11-171-1/+1
|
* zfs: fix build after openzfs/zfs@e63d026b9Martin Matuska2025-11-171-0/+1
| | | | | Fix Makefiles Update zfs_config.h and zfs_gitrev.h
* Fix proc_signame() to use sig2str()Ricardo Branco2025-06-111-1/+6
| | | | | Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
* Remove definition of SIG2STR_MAX from libproc.hRicardo Branco2025-06-111-2/+0
| | | | | Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
* Remove "All Rights Reserved" from FreeBSD Foundation copyrightsEd Maste2024-07-303-3/+0
| | | | | | | These ones were unambiguous cases where the Foundation was the only listed copyright holder. Sponsored by: The FreeBSD Foundation
* Remove residual blank line at start of MakefileWarner Losh2024-07-153-3/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Prepare some build fixes in advance of more _FORTIFY_SOURCEKyle Evans2024-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | ZFS' libspl needs to be made aware that we have strlcat(3) and strlcpy(3) to avoid some more complicated declaration duplication, so go ahead and define these HAVE_ macros now. libprocstat has to define `_KERNEL` and include kernel headers in order to get what it wants, but this results in sys/cdefs.h being included too late and we pick up the build breaking version of the __RENAME definition. Just explicitly include sys/cdefs.h earlier rather than disabling _FORTIFY_SOURCE. The zfs/ subdir only builds an object that holds some structures and sizes, so just disable _FORTIFY_SOURCE there entirely rather than trying to move #define _KERNEL into the file.. While we're here, make sure that we disable _FORTIFY_SOURCE in the bootloader because we don't have the symbol renaming support today to do it as cleanly as we'd like. ssp/ssp.h needs to be pulled into the libsa environment so that other bits can understand that ssp is disabled in the consistent __SSP_FORTIFY_LEVEL way that we try to do. Reviewed by: allanjude (previous version), markj Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45676
* lib: Automated cleanup of cdefs and other formattingWarner Losh2023-11-276-6/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-166-6/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-168-16/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* dtrace: remove dead code for PR_REQUESTEDEric van Gyzen2023-08-011-1/+1
| | | | | | | | | | libproc's PR_REQUESTED is not implemented on FreeBSD. Remove dead code in dtrace that would handle it. Reviewed by: markj MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D41225
* proc_detach: use ptrace(PT_KILL) to kill the traceeEric van Gyzen2023-08-011-8/+4
| | | | | | | | | | | | | | | | | | | | | When MFC'ing commit dad11f990e2 to stable/12, the child would dump core when dtrace exited. It was getting SIGTRAP, even though proc_detach sent a SIGKILL. I could not find the reason for this difference in behavior from main (and stable/13). The present change, however, works as expected, probably due the proc_wkilled special case in kern_ptrace. It also seems like a more obvious approach. While I'm here, fix two other issues in the previous code: It would SIGKILL a tracee even in read-only mode. It would SIGSTOP/SIGCONT the tracee if ptrace succeeded but errno happened to be EBUSY for some other reason. Reviewed by: markj MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D41122
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-128-8/+8
| | | | | | | | | 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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-0/+1
|
* libproc: Trim a MIPS leftover.John Baldwin2023-03-291-1/+0
| | | | Fixes: 101ba46bb6bd libproc: retire now-unused MIPS support
* Retire WITHOUT_CXX optionEd Maste2023-01-271-7/+1
| | | | | | | | | | | | Several important base system components are written in C++, and the WITHOUT_CXX option produced a system that was not fully functional. Just accept this, and remove the option to build without C++ support. This reverts commit adc3c128c6603054586a993d117e5dd808deac17. Reviewed by: brooks, kevans, jhb (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33108
* libproc: retire now-unused MIPS supportEd Maste2022-10-172-11/+0
| | | | Discussed with: imp
* Alter the prototype of qsort_r(3) to match POSIX, which adopted theEd Schouten2022-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | glibc-based interface. Unfortunately, the glibc maintainers, despite knowing the existence of the FreeBSD qsort_r(3) interface in 2004 and refused to add the same interface to glibc based on grounds of the lack of standardization and portability concerns, has decided it was a good idea to introduce their own qsort_r(3) interface in 2007 as a GNU extension with a slightly different and incompatible interface. With the adoption of their interface as POSIX standard, let's switch to the same prototype, there is no need to remain incompatible. C++ and C applications written for the historical FreeBSD interface get source level compatibility when building in C++ mode, or when building with a C compiler with C11 generics support, provided that the caller passes a fifth parameter of qsort_r() that exactly matches the historical FreeBSD comparator function pointer type and does not redefine the historical qsort_r(3) prototype in their source code. Symbol versioning is used to keep old binaries working. MFC: never Relnotes: yes Reviewed by: cem, imp, hps, pauamma Differential revision: https://reviews.freebsd.org/D17083
* libproc: replace home grown crc32 with zlib implementation.Xin LI2022-07-104-98/+9
| | | | | | MFC after: 2 weeks Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D35766
* Remove the MK_LIBCPLUSPLUS optionAlex Richardson2021-02-011-3/+1
| | | | | | | | This option has been equivalent to any form of C++ support since libstdc++ was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D27974
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-011-1/+0
| | | | | | | | | | | | | | | Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Notes: svn path=/head/; revision=366304
* Remove -I flag for include path that doesn't existAlex Richardson2020-09-101-1/+0
| | | | | | | | | | Found this while trying to get macOS bootstrap to work again after OpenZFS merge. Reviewed By: #zfs, freqlabs Differential Revision: https://reviews.freebsd.org/D26192 Notes: svn path=/head/; revision=365580
* Merge OpenZFS support in to HEAD.Matt Macy2020-08-253-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary benefit is maintaining a completely shared code base with the community allowing FreeBSD to receive new features sooner and with less effort. I would advise against doing 'zpool upgrade' or creating indispensable pools using new features until this change has had a month+ to soak. Work on merging FreeBSD support in to what was at the time "ZFS on Linux" began in August 2018. I first publicly proposed transitioning FreeBSD to (new) OpenZFS on December 18th, 2018. FreeBSD support in OpenZFS was finally completed in December 2019. A CFT for downstreaming OpenZFS support in to FreeBSD was first issued on July 8th. All issues that were reported have been addressed or, for a couple of less critical matters there are pull requests in progress with OpenZFS. iXsystems has tested and dogfooded extensively internally. The TrueNAS 12 release is based on OpenZFS with some additional features that have not yet made it upstream. Improvements include: project quotas, encrypted datasets, allocation classes, vectorized raidz, vectorized checksums, various command line improvements, zstd compression. Thanks to those who have helped along the way: Ryan Moeller, Allan Jude, Zack Welch, and many others. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25872 Notes: svn path=/head/; revision=364746
* Re-enable proc_test:symbol_lookup after r360979.Mark Johnston2020-05-121-3/+0
| | | | | | | | | PR: 244732 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=360980
* Temporarily skip 2 failing tests after llvm10 importLi-Wen Hsu2020-03-111-0/+3
| | | | | | | | PR: 244732 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=358887
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-3/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+11
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot2019-09-051-1/+0
| | | | | | | | | | | | | The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
* mips: hide regnum definitions behind _KERNEL/_WANT_MIPS_REGNUMKyle Evans2019-08-221-0/+1
| | | | | | | | | | | | | | | | | | | machine/regnum.h ends up being included by sys/procfs.h and sys/ptrace.h via machine/reg.h. Many of the regnum definitions are too short and too generic to be exposing to any userland application including one of these two headers. Moreover, these actively cause build failures in googletest (template <typename T1 ...> expanding to template <typename 9 ...>). Hide the definitions behind _KERNEL or _WANT_MIPS_REGNUM, and patch all of the userland consumers to define as needed. Discussed with: imp, jhb Reviewed by: imp, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21330 Notes: svn path=/head/; revision=351409
* mips: Fix register target for SP setting in libprocJustin Hibbits2019-08-081-1/+1
| | | | | | | | | Copy-paste-o from r233042 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D21188 Notes: svn path=/head/; revision=350756
* Be consistent about temporary variable use in adjacent loops.Brooks Davis2019-07-221-2/+3
| | | | | | | | | Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=350218
* Remove an unneeded temporary variable in two functions.Brooks Davis2019-07-191-8/+3
| | | | | | | | | | | | There is no need to convert an intptr_t to a long just to cast it to a (void *). Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=350158
* Detach from the child process before completing the test.Mark Johnston2018-07-271-6/+12
| | | | | | | Otherwise the child will receive SIGTRAP if the parent exits first. Notes: svn path=/head/; revision=336782
* Take the mapping's segment offset into account when resolving symbols.Mark Johnston2018-07-211-2/+4
| | | | | | | | Reported by: Jenkins, via asomers MFC after: 2 weeks Notes: svn path=/head/; revision=336592
* Disable optimization of the libproc test program.Mark Johnston2018-07-211-0/+1
| | | | | | | | | | Dead code elimination may remove symbols that are required by the tests. Reported by: Jenkins, via asomers MFC after: 1 week Notes: svn path=/head/; revision=336591
* Use a global extern declaration to appease gcc.Mark Johnston2017-12-061-1/+2
| | | | | | | | Reported by: gjb X-MFC with: r326498 Notes: svn path=/head/; revision=326626
* Add an envp argument to proc_create().Mark Johnston2017-12-034-17/+17
| | | | | | | | | This is needed to support dtrace's -x setenv option. MFC after: 2 weeks Notes: svn path=/head/; revision=326498
* Eliminate the last user of basename_r() in the base system.Ed Schouten2017-12-011-2/+4
| | | | | | | In this case it's fairly easy to make use of basename(). Notes: svn path=/head/; revision=326423
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-268-0/+16
| | | | | | | | | | | | | | | 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
* Refine symtab sorting in libproc.Mark Johnston2017-11-213-29/+193
| | | | | | | | | | | | Add some rules to more closely match what illumos does when an address resolves to multiple symbols: - prefer non-local symbols - prefer symbols with fewer leading underscores and no leading '$' Add some regression tests to verify these rules. Notes: svn path=/head/; revision=326064
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-312-2/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Avoid keeping a dangling pointer when the mappings array is resized.Mark Johnston2017-09-063-3/+4
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=323227
* Add supporting changes for `Add limited sandbox capability to "make check"`Enji Cooper2017-08-141-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-tests/... changes: - Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration and propagate the appropriate environment down to *.test.mk. tests/... changes: - Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner, since tests/... is a special subdirectory tree compared to the others. MFC after: 2 months MFC with: r322511 Reviewed by: arch (silence), testing (silence) Differential Revision: D12014 Notes: svn path=/head/; revision=322515
| * Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | | | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* | o Replace __riscv__ with __riscvRuslan Bukin2017-08-072-5/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 Notes: svn path=/head/; revision=322168
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* Ensure that the mappings table is populated in proc_objname().Mark Johnston2017-05-221-0/+3
| | | | | | | | MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318687