aboutsummaryrefslogtreecommitdiff
path: root/lib/libutil/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* packages: Install development manpages in the -dev packageLexi Winter2025-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | Add a new per-group SUBPACKAGE option to bsd.man.mk. When MANSPLITPKG is enabled, this is forced to "-man", otherwise it defaults to empty but can be overridden by the caller. Use this in bsd.lib.mk to install library manpages in the -dev package instead of the base package. This is nearly always preferable, since library manpages are usually in section 2 or 3 and are only relevant to people with development packages installed. For manpages which should be installed in the base package even for libraries, add a new MANNODEV group in bsd.lib.mk. Update existing Makefiles to use this where appropriate. MFC after: 3 days Discussed with: olce Reviewed by: olce Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52832
* libutil: Remove manual link for nonexistent functionDag-Erling Smørgrav2025-08-121-1/+0
| | | | | | | | | | | | I believe quota_statfs() was the original name of the function now called quota_check_path(). I must have forgotten to update the MLINK when I renamed it. MFC after: 1 week Fixes: 5666aadb3ddf ("Further extend the quotafile API.") Fixes: 22afc767869a ("libutil: Add missing MLINKs") Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D51863
* libutil: Add missing MLINKsDag-Erling Smørgrav2025-08-031-65/+114
| | | | | | MFC after: 1 week Reviewed by: olce, imp, emaste Differential Revision: https://reviews.freebsd.org/D51706
* libutil: Drop auth_getval()Dag-Erling Smørgrav2025-08-021-1/+1
| | | | | | | | | This function has been an empty stub for years; now that we're bumping the library version, we can finally get rid of it. Fixes: 0c381b7f0570 Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D51704
* libutil: Add symbol versioningDag-Erling Smørgrav2025-08-021-1/+4
| | | | | Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D51694
* libutil: Move cpuset(1) domain policy parsing code into libutilBojan Novković2025-07-271-0/+1
| | | | | | | | | | | | | | cpuset(1) implements a domainset(9) policy parser that is used to translate a <policy>:<domain_list> string into a domainset_t mask and a valid domainset policy. This change moves the domainset parsing code into a new cpuset.c function - 'domainset_parselist'. The existing cpuset.c code was refactored into a generalized list parsing function which is now used to parse both CPU sets and domain sets. This is the same approach used in cpuset(1). Reviewed by: markj, ziaee (manpages) Differential Revision: https://reviews.freebsd.org/D46607
* Move mntopts(3) suppport into libutilBrooks Davis2025-04-221-2/+12
| | | | | | | | | | | | | | | | | Many programs use this functionality so it should be available centrally rather than compiled into each program independently. This has the modest downside of adding libutil dependencies to some mount_<foo> programs, but many (plus mount(8)) already have those depndencies so this shouldn't be a major imposition. In commit 906c312bbf74, Kirk said this could be done once the change was merged to FreeBSD 13. That happened in commit 668dfa016698 in 2023. While here perform related tidying including removing SRCS where the only entry is ${PROG}.c rendering it unnecessary. Reviewed by: olce, dim, emaste Differential Revision: https://reviews.freebsd.org/D49951
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+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
* libutil: move ftime to libutilMariusz Zaborski2024-05-291-3/+3
| | | | | | | | | | | | | | | | It seems that there are still some applications that use ftime(3) (for example, science/siconos and sysutils/lcdproc). The issue is that we don't build libcompat as a shared library anymore. The easiest solution is to move it to libutil, until we deprecate it for good. This solution was proposed by kib@ in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257789. PR: 257789 MFC after: 1 month Reviewed by: kib (ages ago) Differential Revision: https://reviews.freebsd.org/D39994
* lib: Remove ancient SCCS tags.Warner Losh2023-11-271-1/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* cpuset(3): Move cpuset's parselist function into libutilBaptiste Daroussin2023-06-011-2/+3
| | | | | | | | | | | | | | In order to allow to add cpuset(2) functionality to more utilities than just cpuset(1) move the parselist code into libutil While here, make the code a little more "library" friendly, by returning a range of various errors so that the consumer can check for them and report appropriate error message to the users (One of the planed usage is the jail(8) utility) Reviewed by: jilles Differential Revision: https://reviews.freebsd.org/D12873
* Add function getlocalbase() to libutil.Stefan Eßer2020-11-181-2/+3
| | | | | | | | | | | | | | | | | | This function returns the path to the local software base directory, by default "/usr/local" (or the value of _PATH_LOCALBASE in include/paths.h when building the world). The value returned can be overridden by 2 methods: - the LOCALBASE environment variable (ignored by SUID programs) - else a non-default user.localbase sysctl value Reviewed by: hps (earlier version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27236 Notes: svn path=/head/; revision=367813
* Revert the whole getlocalbase() set of changes while a different design isScott Long2020-11-151-3/+2
| | | | | | | hashed out. Notes: svn path=/head/; revision=367711
* Add the library function getlocalbase and its manual page. This helps toScott Long2020-11-141-2/+3
| | | | | | | | | | | unify the retrieval of the various ways that the local software base directory, typically "/usr/local", is expressed in the system. Reviewed by: se Differential Revision: https://reviews.freebsd.org/D27022 Notes: svn path=/head/; revision=367686
* pkgbase: Put a lot of binaries and lib in FreeBSD-runtimeEmmanuel Vadot2019-09-051-1/+2
| | | | | | | | | | | | All of them are needed to be able to boot to single user and be able to repair a existing FreeBSD installation so put them directly into FreeBSD-runtime. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21503 Notes: svn path=/head/; revision=351855
* Stop exporting __pw_scan and __pw_initpwd as freebsd-private libc functionsIan Lepore2018-07-271-2/+4
| | | | | | | | | | for use in libutil, and instead compile the small amount of common code directly into libutil with a .PATH reachover. Discussed with: kib@ Notes: svn path=/head/; revision=336779
* Use __SCCSID() for SCCS IDs.John Baldwin2018-05-231-1/+1
| | | | | | | | | - Define NO__SCCSID in CFLAGS to preserve existing behavior of omitting SCCS IDs by default. - While here, fix the $FreeBSD$ in pw_util.c to use __FBSDID. Notes: svn path=/head/; revision=334106
* MFhead@r322057Enji Cooper2017-08-041-0/+1
|\ | | | | | | Notes: svn path=/projects/make-check-sandbox/; revision=322058
| * Introduce the flopenat(3) function.Mariusz Zaborski2017-08-041-0/+1
| | | | | | | | | | | | | | | | Reviewed by: des, emaste Differential Revision: https://reviews.freebsd.org/D11690 Notes: svn path=/head/; revision=322054
* | 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
* 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
* Correct MLINKS for sbuf_hexdump(9)Enji Cooper2017-03-031-1/+0
| | | | | | | | | | | | | sbuf_hexdump(9) should be linked to sbuf(9), not hexdump(3). Another review will be posted to deduplicate the sbuf_hexdump reference in in hexdump(3) or at the very least make the information less duplicative. MFC after: 1 week X-MFC with: r313437 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314587
* Clean up trailing and leading whitespace for variables to make itEnji Cooper2017-02-081-5/+5
| | | | | | | | | | | consistent with the rest of the file and style.Makefile(9) a bit more MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313438
* Create link from hexdump(3) to sbuf_hexdump(9) as the manpage describesEnji Cooper2017-02-081-0/+1
| | | | | | | | | | sbuf_hexdump(9)'s behavior MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313437
* Use SRCTOP-relative paths to other directories instead of .CURDIR-relative onesEnji Cooper2017-01-201-1/+1
| | | | | | | | | | This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312470
* First pass through library packaging.Glen Barber2016-02-041-0/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* List kinfo_getfile.c only once.Brooks Davis2015-06-101-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=284225
* revert r283969,283970 not needed anymore after r283981Baptiste Daroussin2015-06-041-1/+0
| | | | Notes: svn path=/head/; revision=283984
* Add a pw_mkdb2(3) function which does the same thing as pw_mkdb(3) exceptBaptiste Daroussin2015-06-031-0/+1
| | | | | | | | | | | it takes a new argument allowing to specify the endianness of the database to generate Differential Revision: https://reviews.freebsd.org/D2730 Reviewed by: ian Notes: svn path=/head/; revision=283969
* Export a list of VM objects in the system via a sysctl. The list can beJohn Baldwin2015-05-271-2/+4
| | | | | | | | | | | | | examined via 'vmstat -o'. It can be used to determine which files are using physical pages of memory and how much each is using. Differential Revision: https://reviews.freebsd.org/D2277 Reviewed by: alc, kib MFC after: 2 weeks Sponsored by: Norse Corp, Inc. (forward porting to HEAD/10) Notes: svn path=/head/; revision=283624
* Integrate lib/libutil into the build/kyuaEnji Cooper2014-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the .t wrappers Rename all of the TAP test applications from test-<test> to <test>_test to match the convention described in the TestSuite wiki page humanize_number_test.c: - Fix -Wformat warnings with counter variables - Fix minor style(9) issues: -- Header sorting -- Variable declaration alignment/sorting in main(..) -- Fit the lines in <80 columns - Fix an off by one index error in the testcase output [*] - Remove unnecessary `extern char * optarg;` (this is already provided by unistd.h) Phabric: D555 Approved by: jmmv (mentor) MFC after: 2 weeks Obtained from: EMC / Isilon Storage Division [*] Submitted by: Casey Peel <cpeel@isilon.com> [*] Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=269904
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* Document the pw_util(3) functionsBaptiste Daroussin2012-10-301-1/+14
| | | | | | | Reviewed by: des, gjb Notes: svn path=/head/; revision=242381
* Finally nuke auth.conf, nine years after it was deprecated. The onlyDag-Erling Smørgrav2012-06-121-3/+2
| | | | | | | | | | | | | | | | | | | | | thing it was still used for was to set the "global default" password hash. Since the stock auth.conf contained nothing but comments, the global default was actually the first algorithm in crypt(3)'s list, which happens to be DES; I take the fact that nobody noticed as proof that it was not used outside of crypt(3). The only other use in our tree was in the Kerberos support code in in tinyware's passwd(1). I removed that code in an earlier commit; it would not have compiled anyway, as it only supported Kerberos IV. The auth_getval() function is now a stub that always returns NULL, which has the same effect as a functional auth_getval() with an empty auth.conf. MFC after: 3 weeks Notes: svn path=/head/; revision=236965
* Fix disorder in MAN and MLINKS lists.Guy Helmer2012-01-121-37/+37
| | | | | | | Requested by bde. Notes: svn path=/head/; revision=230016
* Add link for pidfile_fileno.3 to pidfile.3 - thanks again pjd!Guy Helmer2012-01-101-1/+2
| | | | Notes: svn path=/head/; revision=229943
* - Commit work from libprocstat project. These patches add support for runtimeStanislav Sedov2011-05-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | file and processes information retrieval from the running kernel via sysctl in the form of new library, libprocstat. The library also supports KVM backend for analyzing memory crash dumps. Both procstat(1) and fstat(1) utilities have been modified to take advantage of the library (as the bonus point the fstat(1) utility no longer need superuser privileges to operate), and the procstat(1) utility is now able to display information from memory dumps as well. The newly introduced fuser(1) utility also uses this library and able to operate via sysctl and kvm backends. The library is by no means complete (e.g. KVM backend is missing vnode name resolution routines, and there're no manpages for the library itself) so I plan to improve it further. I'm commiting it so it will get wider exposure and review. We won't be able to MFC this work as it relies on changes in HEAD, which was introduced some time ago, that break kernel ABI. OTOH we may be able to merge the library with KVM backend if we really need it there. Discussed with: rwatson Notes: svn path=/head/; revision=221807
* IFH@204581Dag-Erling Smørgrav2010-03-041-7/+5
|\ | | | | | | Notes: svn path=/projects/quota64/; revision=204708
| * Remove login(3), logout(3) and logwtmp(3) from libutil.Ed Schouten2010-01-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | These functions only apply to utmp(5). They cannot be kept intact when moving towards utmpx. The login(3) function would break, because its argument is an utmp structure. The logout(3) and logwtmp(3) functions cannot be used, since they provide a functionality which partially overlaps. Increment SHLIB_MAJOR to 9 to indicate the removal. Notes: svn path=/head/; revision=202216
| * Build lib/ with WARNS=6 by default.Ed Schouten2010-01-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and lower it when needed. I'm setting WARNS?=0 for secure/. It seems secure/ includes the Makefile.inc provided by lib/. I'm not going to touch that directory. Most of the code there is contributed anyway. Notes: svn path=/head/; revision=201381
* | Further extend the quotafile API.Dag-Erling Smørgrav2009-09-261-1/+5
| | | | | | | | Notes: svn path=/projects/quota64/; revision=197532
* | Merge from headDag-Erling Smørgrav2009-09-171-1/+1
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=197292
| * Bump the version of all non-symbol-versioned shared libraries inKen Smith2009-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | preparation for 8.0-RELEASE. Add the previous version of those libraries to ObsoleteFiles.inc and bump __FreeBSD_Version. Reviewed by: kib Approved by: re (rwatson) Notes: svn path=/head/; revision=195767
* | Merge from head up to r188941 (last revision before the USB stack switch)Dag-Erling Smørgrav2009-09-171-1/+2
|\| | | | | | | Notes: svn path=/projects/quota64/; revision=197278
| * Add filler man pages for the kinfo functions I added recently.Peter Wemm2008-12-071-1/+2
| | | | | | | | | | | | | | While here, hook up the hexdump(3) man page which wasn't being installed. Notes: svn path=/head/; revision=185729
* | WIPDag-Erling Smørgrav2009-01-301-3/+7
|/ | | | Notes: svn path=/projects/quota64/; revision=187914
* Merge user/peter/kinfo branch as of r185547 into head.Peter Wemm2008-12-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes struct kinfo_filedesc and kinfo_vmentry such that they are same on both 32 and 64 bit platforms like i386/amd64 and won't require sysctl wrapping. Two new OIDs are assigned. The old ones are available under COMPAT_FREEBSD7 - but it isn't that simple. The superceded interface was never actually released on 7.x. The other main change is to pack the data passed to userland via the sysctl. kf_structsize and kve_structsize are reduced for the copyout. If you have a process with 100,000+ sockets open, the unpacked records require a 132MB+ copyout. With packing, it is "only" ~35MB. (Still seriously unpleasant, but not quite as devastating). A similar problem exists for the vmentry structure - have lots and lots of shared libraries and small mmaps and its copyout gets expensive too. My immediate problem is valgrind. It traditionally achieves this functionality by parsing procfs output, in a packed format. Secondly, when tracing 32 bit binaries on amd64 under valgrind, it uses a cross compiled 32 bit binary which ran directly into the differing data structures in 32 vs 64 bit mode. (valgrind uses this to track file descriptor operations and this therefore affected every single 32 bit binary) I've added two utility functions to libutil to unpack the structures into a fixed record length and to make it a little more convenient to use. Notes: svn path=/head/; revision=185548
* Fixed style issues with variable ordering and naming, spacing andSean Farley2008-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | parentheses. Fixed alignment issue in gr_dup() in its assignment of gr_mem using a struct to force alignment without performing alignment mathematics. This was noticed recently with libutil was built with WARNS=6 on platform such as sparc64. Added checks to gr_dup(), gr_equal() and gr_make() to prevent segfaults when examining struct group's with the struct members pointing to NULL's. With fix of alignment issue, restore WARNS?=6. Reviewed by: des MFC after: 1 week Notes: svn path=/head/; revision=185237
* Comment out WARNS. There are too many alignment issues in libutil.Dag-Erling Smørgrav2008-11-051-1/+1
| | | | Notes: svn path=/head/; revision=184677