Commit Graph

85 Commits

Author SHA1 Message Date
ghelmer
7f1af3a697 Fix disorder in MAN and MLINKS lists.
Requested by bde.
2012-01-12 15:45:08 +00:00
ghelmer
cd69e2328d Add link for pidfile_fileno.3 to pidfile.3 - thanks again pjd! 2012-01-10 22:22:35 +00:00
stas
5f9f795476 - Commit work from libprocstat project. These patches add support for runtime
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
2011-05-12 10:11:39 +00:00
des
834fb25a9e IFH@204581 2010-03-04 13:35:57 +00:00
ed
fc12a579a0 Remove login(3), logout(3) and logwtmp(3) from libutil.
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.
2010-01-13 18:59:51 +00:00
ed
09818ac28e Build lib/ with WARNS=6 by default.
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.
2010-01-02 09:58:07 +00:00
des
a45436ee47 Further extend the quotafile API. 2009-09-26 23:16:06 +00:00
des
9ed1a4b5eb Merge from head 2009-09-17 16:16:44 +00:00
des
7ee29ca499 Merge from head up to r188941 (last revision before the USB stack switch) 2009-09-17 13:31:39 +00:00
kensmith
9c2c634ee9 Bump the version of all non-symbol-versioned shared libraries in
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)
2009-07-19 17:25:24 +00:00
des
604db9f61a WIP 2009-01-30 13:54:03 +00:00
peter
deea9bd48d Add filler man pages for the kinfo functions I added recently.
While here, hook up the hexdump(3) man page which wasn't being installed.
2008-12-07 03:33:36 +00:00
peter
16271b5bfa Add experimental front ends to the kinfo_vmentry and kinfo_filedesc
sysctls.
2008-11-30 22:40:14 +00:00
scf
3396c8ff44 Fixed style issues with variable ordering and naming, spacing and
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
2008-11-23 23:26:12 +00:00
des
8dd958ae17 Comment out WARNS. There are too many alignment issues in libutil. 2008-11-05 11:06:10 +00:00
des
52c1c041c4 Disconnect gr_util.c from the build. It isn't documented or used anywhere
in the tree, and due to unsafe pointer arithmetic, it will most likely crash
on architectures with strict alignment requirements.
2008-11-05 10:45:39 +00:00
des
07619c0f0d libutil now builds at WARNS level 6.
MFC after:	3 weeks
2008-11-04 13:51:15 +00:00
jhb
b3f9efd84f Merge hexdump(9) to userland as hexdump(3) in libutil. I'm tired of doing
this by hand in userland utilities.

MFC after:	1 month
2008-07-01 22:30:57 +00:00
scf
cab3742f10 Add four utility functions related to struct grp processing modeled in-part
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
2008-04-23 00:49:13 +00:00
pjd
cc12b6df61 Implement expand_number(3), which is the opposite of humanize_number(3), ie.
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)
2007-09-01 06:19:11 +00:00
deischen
ff36458e08 Bump library versions in preparation for 7.0.
Ok'd by:	kan
2007-05-21 02:49:08 +00:00
des
5d25ea6b62 I'm tired of seeing this done incorrectly and non-portably, so add a
flopen(3) function which reliably opens and locks a file.

MFC after:	3 weeks
2007-05-10 14:43:31 +00:00
yar
c6e8412606 style.Makefile(5) is good for our eyes. 2006-07-27 12:36:46 +00:00
akiyama
f9f3be843b Specify default path for SHLIBDIR before bsd.own.mk does.
This fix shared library installed correct place.
2006-06-11 09:14:06 +00:00
delphij
1489501378 Don't build IPv6 support if we have choosen not to have it. 2006-06-09 18:11:29 +00:00
ume
2d16d1ab8e Bump library majro version for gethostbyaddr(3). 2006-05-21 15:15:21 +00:00
des
748c235cfd Add utility functions for checking if a given kernel module is loaded,
and loading it.
2006-02-18 11:25:28 +00:00
pjd
a5fe3401b9 Add a family of functions for reliable pidfiles handling.
Idea from:	jmg
Discussed on:	arch@
2005-08-24 17:21:38 +00:00
kensmith
f97f77429f Bump the shared library version number of all libraries that have not
been bumped since RELENG_5.

Reviewed by:	ru
Approved by:	re (not needed for commit check but in principle...)
2005-07-22 17:19:05 +00:00
pjd
d207894810 Add humanize_number(3) to libutil for formating numbers into a human
readable form.

Obtained from:	NetBSD
2004-05-24 22:19:27 +00:00
kientzle
48517ca7da Back out the "clean_environment()" function from libutil.
Further contemplation has convinced me that this was
not going to really solve the problem of environment-poisoning
without raising serious administrative headaches.  There
must be a better way...
2004-02-29 22:13:28 +00:00
kientzle
8b8fb9aae5 Add a clean_environment call to libutil.
This function removes all environment variables except
the ones listed on a "whitelist."

The function accepts two whitelist arguments.
If the first is NULL, a built-in default list will be
used.  This allows callers to get a variety of behaviors:
  * Default screening: provide NULL for both lists
  * Custom screening: provide a custom list for the first argument
  * Modified default screening: provide NULL for first arg,
     list of additional variables to preserve in the second arg

Idea from: Jacques Vidrine

MFC after: 2 weeks
2004-02-26 22:41:47 +00:00
rwatson
ba0d21ac7c Bump the major version on libtuil. libutil now relies on the mac_*
symbols exported by newer versions of libc, and so we want applications
depending on the newer library code to be required to link against the
newer libc.

Discussed with:	scottl, kris, imp
2003-11-12 21:56:07 +00:00
markm
4d1565cf18 Remove a GCC specifig CFLAG. We should be using WARNS=? for this.
WARNS=? is not added here at this point, because I've not tested
it on enough platforms, and I don't want to break builds.
2003-10-18 09:58:39 +00:00
obrien
372364ee0f style.Makefile(5) 2003-08-18 15:25:39 +00:00
gordon
5901302929 Stage 3 of dynamic root support. Make all the libraries needed to run
binaries in /bin and /sbin installed in /lib. Only the versioned files
reside in /lib, the .so symlink continues to live /usr/lib so the
toolchain doesn't need to be modified.
2003-08-17 08:28:46 +00:00
peter
0a7f0ba37e Zap now-unused SHLIB_MINOR 2002-09-28 00:25:32 +00:00
sobomax
43c345ecb4 Backout previous delta (addition of -I${.CURDIR}/../../sys).
Submitted by:	bde
2002-06-26 13:25:23 +00:00
sobomax
d2858dfb8c Add -I${.CURDIR}/../../sys into CFLAGS, which should fix the world broken
by RLIMIT_VMEM addition.
2002-06-26 10:33:10 +00:00
des
ac9ea0e5ca Add passwd manipulation code based on parts of vipw and chpass.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:50:07 +00:00
rwatson
a86bfc340f o Reflect repo-copy of extattr.[c3] from libutil to libc, moving
extattr namespace routines to the libc/posix1e directory.  While
  the extattr calls are not strictly POSIX.1e, POSIX.1e wasn't
  strictly ever approved, so I think that's OK.

Obtained from:	TrustedBSD Project
2001-11-16 05:09:45 +00:00
assar
6ea84229c5 remove emalloc,ecalloc,erealloc,estrdup 2001-07-23 12:42:07 +00:00
assar
8668d65218 add ecalloc, emalloc, erealloc, estrdup - versions of the e-less
functions that exit instead of failing
2001-07-22 22:26:37 +00:00
dd
4d18dfe3ca Add a manual page for extattr_string_to_namespace and
extattr_namespace_to_string.

Reviewed by:	rwatson
2001-06-24 23:54:46 +00:00
ru
52a9144c8b Removed -I${.CURDIR}/.../sys from CFLAGS. 2001-05-18 13:41:42 +00:00
ru
25ef23ac1c MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
rwatson
f843a4812b o To support new EA interface with explicit namespaces, introduce two
utility functions which convert between string namespace names and
  numeric constants used by the interface.  Right now, two namespaces
  are supported, EXTATTR_NAMESPACE_SYSTEM ("system") and
  EXTATTR_NAMESPACE_USER ("user").  These functions are used by
  various userland EA utilities, rather than hard coding the routines
  all over the place.

Obtained from:	TrustedBSD Project
2001-03-15 03:00:39 +00:00
brian
8a3521bf30 Move trimdomain() into it's own source file and tidy things up a bit.
Fix disorder in the Makefile.

Reviewed (mostly) by: bde
2001-03-14 20:51:15 +00:00
green
4873d87d03 Fix problems people were having with large -O levels with GCC and
getting libutil/libcrypt to work properly.  I've determined that GCC
thinks it can inline all functions, including weak-symboled ones, if
it feels like it.

Create a new stub.c and move any stubs there to prevent inlining.
Thanks to jdp and William S. Duncanson for helping me finally find the
problem.
2000-10-27 01:19:02 +00:00
brian
5990f9fefc Move setproctitle() from libutil to libc (after a repo-copy)
and bump __FreeBSD_version to 500012 to mark the occasion.

setproctitle() is prototyped in unistd.h as opposed to stdlib.h
where OpenBSD and NetBSD have it.

Reviewed by: peter
2000-09-02 01:51:36 +00:00