1.\" $NetBSD: util.3,v 1.18 2008/11/17 15:21:43 wiz 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 November 17, 2008 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. 49Declarations for these functions may be obtained from the include file 50.Pa \*[Lt]util.h\*[Gt] . 51.Sh LIST OF FUNCTIONS 52.sp 2 53.nf 54.ta \w'getmaxpartitions.3'u+2n +\w'get the maximum number of partitions allowed per disk'u 55\fIName/Page\fP \fIDescription\fP 56.ta \w'getmaxpartitions.3'u+2n +\w'get the maximum number of partitions allowed per disk'u+6nC 57.sp 5p 58disklabel_dkcksum.3 compute the checksum for a disklabel 59disklabel_scan.3 scan a buffer for a valid disklabel 60forkpty.3 tty utility function 61getbootfile.3 get the name of the booted kernel file 62getlabeloffset.3 get the sector number and offset of the disklabel 63getlabelsector.3 get the sector number and offset of the disklabel 64getmaxpartitions.3 get the maximum number of partitions allowed per disk 65getrawpartition.3 get the system ``raw'' partition 66login.3 login utility function 67login_cap.3 query login.conf database about a user class 68login_close.3 query login.conf database about a user class 69login_getcapbool.3 query login.conf database about a user class 70login_getcapnum.3 query login.conf database about a user class 71login_getcapsize.3 query login.conf database about a user class 72login_getcapstr.3 query login.conf database about a user class 73login_getcaptime.3 query login.conf database about a user class 74login_getclass.3 query login.conf database about a user class 75login_tty.3 tty utility function 76loginx.3 login utility function 77logout.3 login utility function 78logoutx.3 login utility function 79logwtmp.3 login utility function 80logwtmpx.3 login utility function 81opendisk.3 open a disk partition 82openpty.3 tty utility function 83pidfile.3 write a daemon pid file 84pidlock.3 locks based on files containing PIDs 85pw_abort.3 passwd file update function 86pw_copy.3 utility function for interactive passwd file updates 87pw_edit.3 utility function for interactive passwd file updates 88pw_error.3 utility function for interactive passwd file updates 89pw_getconf.3 password encryption configuration access function 90pw_getprefix.3 passwd file update function 91pw_init.3 utility function for interactive passwd file updates 92pw_lock.3 passwd file update function 93pw_mkdb.3 passwd file update function 94pw_prompt.3 utility function for interactive passwd file updates 95pw_scan.3 utility function for interactive passwd file updates 96pw_setprefix.3 passwd file update function 97secure_path.3 determine if a file appears to be ``secure'' 98setclasscontext.3 query login.conf database about a user class 99setusercontext.3 query login.conf database about a user class 100snprintb.3 bitmask output conversion 101sockaddr_snprintf.3 socket address formatting function 102ttyaction.3 ttyaction utility function 103ttylock.3 locks based on files containing PIDs 104ttymsg.3 ttymsg utility function 105ttyunlock.3 locks based on files containing PIDs 106.fi 107.Sh FILES 108.Bl -tag -width /usr/lib/libutil_p.a -compact 109.It Pa /usr/lib/libutil.a 110static util library 111.It Pa /usr/lib/libutil.so 112dynamic util library 113.It Pa /usr/lib/libutil_p.a 114static util library compiled for profiling 115.El 116.Sh SEE ALSO 117.Xr efun 3 118