summaryrefslogtreecommitdiffstats
path: root/lib/libutil/libutil.h
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup gr_add() so it does not leak memdb2013-03-071-1/+1
| | | | | | | | | This is part of ongoing work on sbin/pw M libutil.h M gr_util.c Approved by: theraven
* - Clean up previous gr_add use malloc instead of callocbapt2012-12-271-1/+1
| | | | | | - Fix tinderbox error Submitted by: db
* New gr_add function to provide a clean and safe method to append a new memberbapt2012-12-271-0/+2
| | | | | | into an existing group. Submitted by: db
* Consensus between bde and pjd seemed to be that if the function namesghelmer2012-01-261-8/+8
| | | | | | are lined up, then any * after a long type should appear after the type instead of being in front of the function name on the following line.
* Make the comments consistent (capitalization, punctuation, andghelmer2012-01-261-6/+10
| | | | | | format). Requested by bde
* Restore the parenthesis that are necessary around the constant values.ghelmer2012-01-261-7/+7
| | | | Requested by bde.
* Fix more disorder in prototypes and constants.ghelmer2012-01-161-46/+43
| | | | | | Fix header comments for each section of constants. Fix whitespace in #define lines. Fix unnecessary parenthesis in constants.
* Move struct pidfh definition into pidfile.c, and leave a forward declarationghelmer2012-01-121-12/+6
| | | | | | | | | for pidfh in libutil.h in its place. This allows us to hide the contents of the pidfh structure, and also allowed removal of the "#ifdef _SYS_PARAM_H" guard from around the pidfile_* function prototypes. Suggested by pjd.
* More prototype formatting fixes, struct member formatting fixes,ghelmer2012-01-121-10/+17
| | | | | | and namespace fix for property_find() prototype. Provided by bde.
* Fix prototype formatting (indentation, long lines, and continued lines).ghelmer2012-01-111-23/+30
| | | | Requested by bde.
* Fix namespace issues with prototype parameter names.ghelmer2012-01-111-32/+32
| | | | | | Add missing prototype parameter names. Requested by bde.
* Fix forward structure declaration and prototype disorder.ghelmer2012-01-111-34/+33
| | | | Requested by bde.
* Constify arguments.pjd2012-01-111-1/+1
|
* Add pidfile_fileno() to obtain the file descriptor for an openghelmer2012-01-101-0/+1
| | | | pidfile.
* Add new pw_make_v7 to make a passwd line (in v7 format) out of a struct passwdbapt2012-01-051-0/+1
| | | | | | while here, fix missing parentheses of the return statement of pw_make. Approved by: des (mentor)
* Modify pw_copy:bapt2011-12-151-1/+7
| | | | | | | | | | | | | - if pw is NULL and oldpw is not NULL then the oldpw is deleted - if pw->pw_name != oldpw->pw_name but pw->pw_uid == oldpw->pw_uid then it renames the user add new gr_* functions so now gr_util API is similar to pw_util API, this allow to manipulate groups in a safe way. Reviewed by: des Approved by: des MFC after: 1 month
* - Commit work from libprocstat project. These patches add support for runtimestas2011-05-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* Don't duplicate define the stdint types.obrien2011-05-051-10/+1
|
* Add support for IEE/IEC (and now also SI) power of two notions ofdelphij2011-04-121-0/+2
| | | | | | | | | | prefixes (Ki, Mi, Gi...) for humanize_number(3). Note that applications has to pass HN_IEC_PREFIXES to use this feature for backward compatibility reasons. Reviewed by: arundel MFC after: 2 weeks
* expand_number() needs uint64_t, declare it here if not already declared.pjd2011-03-061-0/+5
| | | | MFC after: 3 days
* Simplify expand_number() by combining the (unrolled) loop with thedes2010-08-141-1/+1
| | | | | | | 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
* IFH@204581des2010-03-041-4/+28
|\
| * Remove login(3), logout(3) and logwtmp(3) from libutil.ed2010-01-131-4/+0
| | | | | | | | | | | | | | | | | | | | 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.
| * Make <libutil.h> work when included by itself.ed2009-12-021-0/+28
| | | | | | | | | | | | | | There are several reasons why it didn't work: - It was missing <sys/cdefs.h> for __BEGIN_DECLS. - It uses various primitive types that were not declared.
* | Add and document the quota_convert function which converts between themckusick2009-12-281-0/+1
| | | | | | | | old 32-bit and the new 64-bit formats.
* | Add and document new quoat_on and quota_off functions.mckusick2009-11-161-1/+3
| |
* | Add quota_maxid which returns the maximum user (or group) identifiermckusick2009-10-201-0/+1
| | | | | | | | | | | | in an associated quotafile. Needed by repquota. Bug fix in quota_read.
* | Further extend the quotafile API.des2009-09-261-1/+4
| |
* | Update the quotafile library to manage both active quotas via themckusick2009-02-141-4/+3
| | | | | | | | | | | | | | | | quotactl(2) interface and inactive quotas by accessing the quota files directly. Update the edquota program to use this new interface as proof of concept.
* | Make hasquota thread safe.mckusick2009-02-131-1/+1
| |
* | Move hasquota() function to libutil.mckusick2009-02-131-0/+2
| |
* | WIPdes2009-01-301-0/+9
|/
* Add experimental front ends to the kinfo_vmentry and kinfo_filedescpeter2008-11-301-0/+6
| | | | sysctls.
* Merge hexdump(9) to userland as hexdump(3) in libutil. I'm tired of doingjhb2008-07-011-0/+8
| | | | | | this by hand in userland utilities. MFC after: 1 month
* Add four utility functions related to struct grp processing modeled in-partscf2008-04-231-0/+7
| | | | | | | | | | | | | | | | | | | after similar calls related to struct pwd in libutil/pw_util.c: - gr_equal() Perform a deep comparison of two struct grp's. It does a thorough, yet unoptimized comparison of all the members regardless of order. - gr_make() Create a string (see group(5)) from a struct grp. - gr_dup() Duplicate a struct grp. Returns a value that is a single contiguous block of memory. - gr_scan() Create a struct grp from a string (as produced by gr_make()). MFC after: 3 weeks
* Constify the first argument to expand_number() so that it canjb2007-11-181-1/+1
| | | | be called with a const without the compiler grisling.
* Implement expand_number(3), which is the opposite of humanize_number(3), ie.pjd2007-09-011-0/+1
| | | | | | | | | | a number in human-readable form is converted to int64_t, for example: 123b -> 123 10k -> 10240 16G -> 17179869184 First version submitted by: Eric Anderson <anderson@freebsd.org> Approved by: re (bmah)
* Well gag me with a spoon... I'm so used to working at high WARNS levelsdes2007-05-101-1/+1
| | | | that I make stupid fundamental mistakes like this when I don't.
* I'm tired of seeing this done incorrectly and non-portably, so add ades2007-05-101-0/+1
| | | | | | flopen(3) function which reliably opens and locks a file. MFC after: 3 weeks
* Add utility functions for checking if a given kernel module is loaded,des2006-02-181-0/+5
| | | | and loading it.
* Add a family of functions for reliable pidfiles handling.pjd2005-08-241-0/+17
| | | | | Idea from: jmg Discussed on: arch@
* Add humanize_number(3) to libutil for formating numbers into a humanpjd2004-05-241-0/+11
| | | | | | readable form. Obtained from: NetBSD
* Add the clean_environment call to libutil.h also.kientzle2004-02-261-0/+2
| | | | MFC after: 2 weeks
* ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.markm2003-10-181-6/+4
|
* Add passwd manipulation code based on parts of vipw and chpass.des2002-05-081-0/+29
| | | | Sponsored by: DARPA, NAI Labs
* Remove multi-line __P() usage.obrien2002-03-221-8/+7
|
* Remove __P() usage.obrien2002-03-211-17/+17
|
* remove emalloc,ecalloc,erealloc,estrdupassar2001-07-231-4/+0
|
* add ecalloc, emalloc, erealloc, estrdup - versions of the e-lessassar2001-07-221-0/+4
| | | | functions that exit instead of failing
* o Slap some "_"'s in front of variable names relating to extattr functions,rwatson2001-03-221-3/+3
| | | | | | so as not to pollute application namespace. Submitted by: bde
OpenPOWER on IntegriCloud