summaryrefslogtreecommitdiffstats
path: root/lib/libutil
Commit message (Collapse)AuthorAgeFilesLines
* In pidfile_open(), if the pidfile is locked, but empty (PID is not stored yet)pjd2011-10-162-22/+27
| | | | | | | | | | | and the caller requested other process' PID by passing non-NULL pidptr argument, we will wait at most 100ms for the PID to show up in the file and if it won't, we will store -1 in *pidptr. From now on, pidfile_open() function never sets errno to EAGAIN on failure. In collaboration with: des MFC after: 1 week
* Add missing "swapuse" resource limit.trasz2011-07-091-1/+2
|
* - Commit work from libprocstat project. These patches add support for runtimestas2011-05-126-2/+325
| | | | | | | | | | | | | | | | | | | | | | | 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-123-27/+89
| | | | | | | | | | 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
* Add missing resource limits:pluknet2011-03-241-12/+14
| | | | | | | - RLIMIT_NPTS - RLIMIT_SWAP MFC after: 1 week
* humanize_number(3) multiply the input number by 100, which could cause andelphij2011-03-231-16/+24
| | | | | | | | | | | | integer overflow when the input is very large (for example, 100 Pi would become about 10 Ei which exceeded signed int64_t). Solve this issue by splitting the division into two parts and avoid the multiplication. PR: bin/146205 Reviewed by: arundel MFC after: 1 month
* s/buffer/buf as is used in the code.gjb2011-03-211-5/+5
| | | | | Submitted by: arundel (via doc@) MFC after: 3 days
* expand_number() needs uint64_t, declare it here if not already declared.pjd2011-03-061-0/+5
| | | | MFC after: 3 days
* Mention setloginclass(2) in login_class(3).trasz2011-03-061-2/+7
|
* Add two new system calls, setloginclass(2) and getloginclass(2). This makestrasz2011-03-052-1/+25
| | | | | | | | | it possible for the kernel to track login class the process is assigned to, which is required for RCTL. This change also make setusercontext(3) call setloginclass(2) and makes it possible to retrieve current login class using id(1). Reviewed by: kib (as part of a larger patch)
* mdoc: drop redundant .Pp and .LP callsuqs2010-10-082-2/+0
| | | | They have no effect when coming in pairs, or before .Bl/.Bd
* UTFize my name.des2010-08-221-1/+1
|
* Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki whilejoel2010-08-161-2/+2
| | | | | | translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
* In setusercontext(), do not apply user settings unless running as thedes2010-08-161-1/+1
| | | | | | | | user in question (usually but not necessarily because we were called with LOGIN_SETUSER). This plugs a hole where users could raise their resource limits and expand their CPU mask. MFC after: 3 weeks
* Old patch I had lying around: clean up and use stpcpy(3) instead ofdes2010-08-161-27/+34
| | | | sprintf(3).
* Further simplify the code, and update the manpage.des2010-08-152-26/+27
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
* no-op commit to note that the example given in the previous commit isdes2010-08-151-1/+1
| | | | | | | | | a very bad one, since the shift does not actually overflow. This is a better example (assuming uint64_t = unsigned long long): ~0LLU >> 9 = 0x7fffffffffffffLLU ~0LLU >> 9 << 10 = 0xfffffffffffffc00LLU ~0LLU >> 9 << 10 >> 10 = 0x3fffffffffffffLLU
* Fix the overflow test. It is possible for the result of andes2010-08-151-1/+1
| | | | | | | overflowing shift to be larger than the original value, e.g. (uint64_t)1 << 53 = 0x20000000000000 ((uint64_t)1 << 53) << 10 = 0x8000000000000000
* Simplify expand_number() by combining the (unrolled) loop with thedes2010-08-142-27/+27
| | | | | | | 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
* Fix typos and spelling mistakes.joel2010-08-061-1/+1
|
* Spelling fixes.joel2010-08-033-3/+3
|
* Update to current version of head.mckusick2010-04-2819-25/+18
|\
| * mdoc: order prologue macros consistently by Dd/Dt/Osuqs2010-04-1418-18/+18
| | | | | | | | | | | | | | | | Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. Reviewed by: ru Approved by: philip, ed (mentors)
| * The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-021-7/+0
| | | | | | | | | | | | their software. Obtained from: NetBSD
* | Debugging nits found while testing the new 64-bit quota code.mckusick2010-03-161-16/+18
| |
* | IFH@204581des2010-03-0411-469/+40
|\ \ | |/
| * Fix a regression that was introduced in r191882.ed2010-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | I changed login_tty() to only work when the application is not a session leader yet. This works fine for applications in the base system, but it turns out various applications call this function after daemonizing, which means they already use their own session. If setsid() fails, just call tcsetsid() on the current session. tcsetsid() will already perform proper security checks. Reported by: Oliver Lehmann MFC after: 1 week
| * Remove login(3), logout(3) and logwtmp(3) from libutil.ed2010-01-138-459/+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.
| * Build lib/ with WARNS=6 by default.ed2010-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.
| * Remove a dead store.scf2009-12-121-2/+2
| | | | | | | | MFC after: 5 days
| * 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.
| * sigset() is the name of function specified by SUSv4.kib2009-11-261-4/+4
| | | | | | | | | | | | Replace it to avoid conflict. MFC after: 3 weeks
* | Add and document the quota_convert function which converts between themckusick2009-12-283-10/+124
| | | | | | | | old 32-bit and the new 64-bit formats.
* | Minor bugs turned up during conversion of quotacheck.mckusick2009-12-271-6/+7
| |
* | Add and document new quoat_on and quota_off functions.mckusick2009-11-163-49/+104
| |
* | Add quota_maxid which returns the maximum user (or group) identifiermckusick2009-10-203-5/+36
| | | | | | | | | | | | in an associated quotafile. Needed by repquota. Bug fix in quota_read.
* | Further extend the quotafile API.des2009-09-264-42/+137
| |
* | Styledes2009-09-251-6/+6
| |
* | Merge from headdes2009-09-179-41/+41
|\ \ | |/
| * Bump the version of all non-symbol-versioned shared libraries inkensmith2009-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)
| * Fix copy-and-paste-o's from kinfo_getfile.3 in kinfo_getvmmap.3.rwatson2009-06-241-2/+2
| | | | | | | | MFC after: 3 days
| * Merge NetBSD revision 1.14: humanize_number.c is now 2-clause BSD licensed.delphij2009-06-231-8/+1
| | | | | | | | | | | | | | (humanize_number.3 intentionally hold back until I make sure why we didn't merged dehumanize_number(3)). Obtained from: NetBSD
| * Usermode portion of the support for swap allocation accounting:kib2009-06-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | - update for getrlimit(2) manpage; - support for setting RLIMIT_SWAP in login class; - addition to the limits(1) and sh and csh limit-setting builtins; - tuning(7) documentation on the sysctls controlling overcommit. In collaboration with: pho Reviewed by: alc Approved by: re (kensmith)
| * Note that the structures are defined in <sys/user.h> in the text (usingjhb2009-06-152-4/+4
| | | | | | | | | | | | language from stat(2)) rather than in the synopsis. Requested by: bde
| * - Note that these interfaces require <sys/user.h> for the structurejhb2009-06-122-2/+12
| | | | | | | | | | | | | | definitions. - Note that these functions return NULL on failure. MFC after: 3 days
| * Revert (once again, and hopefully for the last time) to flock(2) locks.des2009-06-062-23/+14
| | | | | | | | | | | | The problem with fcntl(2) locks is that they are not inherited by child processes. This breaks pidfile(3), where the common idiom is to open and lock the PID file before daemonizing.
| * Add missing .Ppdes2009-06-061-0/+1
| |
| * Add tcsetsid(3).ed2009-05-071-3/+7
| | | | | | | | | | | | | | | | | | | | | | The entire world seems to use the non-standard TIOCSCTTY ioctl to make a TTY a controlling terminal of a session. Even though tcsetsid(3) is also non-standard, I think it's a lot better to use in our own source code, mainly because it's similar to tcsetpgrp(), tcgetpgrp() and tcgetsid(). I stole the idea from QNX. They do it the other way around; their TIOCSCTTY is just a wrapper around tcsetsid(). tcsetsid() then calls into an IPC framework.
* | Merge from head up to r188941 (last revision before the USB stack switch)des2009-09-175-11/+161
|\ \ | |/
OpenPOWER on IntegriCloud