1.\" $NetBSD: util.3,v 1.21 2010/05/05 06:11:14 jruoho Exp $ 2.\" 3.\" Copyright (c) 2001 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Gregory McGarry. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd May 5, 2010 31.Dt UTIL 3 32.Os 33.Sh NAME 34.Nm util 35.Nd system utilities library 36.Sh LIBRARY 37.Lb libutil 38.Sh DESCRIPTION 39The 40.Nm 41library is the system utilities library and contains various 42system-dependent utility routines used in a wide variety of system daemons. 43The abstracted functions are mostly related to pseudo-terminals 44and login accounting. 45These routines are 46.Nx Ns -specific 47and are not portable. 48Their use should be restricted. 49.Pp 50Declarations for these functions may be obtained from the include file 51.In util.h . 52The 53.Nm 54library and the associated functions are implemented within the 55.Pa /usr/src/lib/libutil 56directory. 57.Sh LIST OF FUNCTIONS 58.Bl -column ".Xr sockaddr_snprintf 3" -compact 59.It Sy Name Description 60.It Xr disklabel_dkcksum 3 Ta compute the checksum for a disklabel 61.It Xr disklabel_scan 3 Ta scan a buffer for a valid disklabel 62.It Xr forkpty 3 Ta tty utility function 63.It Xr getbootfile 3 Ta get the name of the booted kernel file 64.It Xr getlabeloffset 3 Ta get the sector number and offset of the disklabel 65.It Xr getlabelsector 3 Ta get the sector number and offset of the disklabel 66.It Xr getmaxpartitions 3 Ta get the maximum number of partitions allowed per disk 67.It Xr getrawpartition 3 Ta get the system ``raw'' partition 68.It Xr login 3 Ta login utility function 69.It Xr login_cap 3 Ta query login.conf database about a user class 70.It Xr login_close 3 Ta query login.conf database about a user class 71.It Xr login_getcapbool 3 Ta query login.conf database about a user class 72.It Xr login_getcapnum 3 Ta query login.conf database about a user class 73.It Xr login_getcapsize 3 Ta query login.conf database about a user class 74.It Xr login_getcapstr 3 Ta query login.conf database about a user class 75.It Xr login_getcaptime 3 Ta query login.conf database about a user class 76.It Xr login_getclass 3 Ta query login.conf database about a user class 77.It Xr login_tty 3 Ta tty utility function 78.It Xr loginx 3 Ta login utility function 79.It Xr logout 3 Ta login utility function 80.It Xr logoutx 3 Ta login utility function 81.It Xr logwtmp 3 Ta login utility function 82.It Xr logwtmpx 3 Ta login utility function 83.It Xr opendisk 3 Ta open a disk partition 84.It Xr openpty 3 Ta tty utility function 85.It Xr pidfile 3 Ta write a daemon pid file 86.It Xr pidlock 3 Ta locks based on files containing PIDs 87.It Xr pw_abort 3 Ta passwd file update function 88.It Xr pw_copy 3 Ta utility function for interactive passwd file updates 89.It Xr pw_edit 3 Ta utility function for interactive passwd file updates 90.It Xr pw_error 3 Ta utility function for interactive passwd file updates 91.It Xr pw_getconf 3 Ta password encryption configuration access function 92.It Xr pw_getprefix 3 Ta passwd file update function 93.It Xr pw_init 3 Ta utility function for interactive passwd file updates 94.It Xr pw_lock 3 Ta passwd file update function 95.It Xr pw_mkdb 3 Ta passwd file update function 96.It Xr pw_prompt 3 Ta utility function for interactive passwd file updates 97.It Xr pw_scan 3 Ta utility function for interactive passwd file updates 98.It Xr pw_setprefix 3 Ta passwd file update function 99.It Xr secure_path 3 Ta determine if a file appears to be ``secure'' 100.It Xr setclasscontext 3 Ta query login.conf database about a user class 101.It Xr setusercontext 3 Ta query login.conf database about a user class 102.It Xr snprintb 3 Ta bitmask output conversion 103.It Xr sockaddr_snprintf 3 Ta socket address formatting function 104.It Xr ttyaction 3 Ta ttyaction utility function 105.It Xr ttylock 3 Ta locks based on files containing PIDs 106.It Xr ttymsg 3 Ta ttymsg utility function 107.It Xr ttyunlock 3 Ta locks based on files containing PIDs 108.El 109.Sh FILES 110.Bl -tag -width /usr/lib/libutil_p.a -compact 111.It Pa /usr/lib/libutil.a 112static util library 113.It Pa /usr/lib/libutil.so 114dynamic util library 115.It Pa /usr/lib/libutil_p.a 116static util library compiled for profiling 117.El 118.Sh SEE ALSO 119.Xr efun 3 , 120.Xr intro 3 121