1*dba3562dSLionel Sambuc.\" $NetBSD: util.3,v 1.24 2011/08/29 12:39:50 jruoho Exp $ 20c3983b2SBen Gras.\" 30c3983b2SBen Gras.\" Copyright (c) 2001 The NetBSD Foundation, Inc. 40c3983b2SBen Gras.\" All rights reserved. 50c3983b2SBen Gras.\" 60c3983b2SBen Gras.\" This code is derived from software contributed to The NetBSD Foundation 70c3983b2SBen Gras.\" by Gregory McGarry. 80c3983b2SBen Gras.\" 90c3983b2SBen Gras.\" Redistribution and use in source and binary forms, with or without 100c3983b2SBen Gras.\" modification, are permitted provided that the following conditions 110c3983b2SBen Gras.\" are met: 120c3983b2SBen Gras.\" 1. Redistributions of source code must retain the above copyright 130c3983b2SBen Gras.\" notice, this list of conditions and the following disclaimer. 140c3983b2SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 150c3983b2SBen Gras.\" notice, this list of conditions and the following disclaimer in the 160c3983b2SBen Gras.\" documentation and/or other materials provided with the distribution. 170c3983b2SBen Gras.\" 180c3983b2SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 190c3983b2SBen Gras.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 200c3983b2SBen Gras.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 210c3983b2SBen Gras.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 220c3983b2SBen Gras.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 230c3983b2SBen Gras.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 240c3983b2SBen Gras.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 250c3983b2SBen Gras.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 260c3983b2SBen Gras.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 270c3983b2SBen Gras.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 280c3983b2SBen Gras.\" POSSIBILITY OF SUCH DAMAGE. 290c3983b2SBen Gras.\" 30*dba3562dSLionel Sambuc.Dd August 29, 2011 310c3983b2SBen Gras.Dt UTIL 3 320c3983b2SBen Gras.Os 330c3983b2SBen Gras.Sh NAME 34*dba3562dSLionel Sambuc.Nm util , 35*dba3562dSLionel Sambuc.Nm libutil 360c3983b2SBen Gras.Nd system utilities library 370c3983b2SBen Gras.Sh LIBRARY 380c3983b2SBen Gras.Lb libutil 390c3983b2SBen Gras.Sh DESCRIPTION 400c3983b2SBen GrasThe 410c3983b2SBen Gras.Nm 420c3983b2SBen Graslibrary is the system utilities library and contains various 430c3983b2SBen Grassystem-dependent utility routines used in a wide variety of system daemons. 440c3983b2SBen GrasThe abstracted functions are mostly related to pseudo-terminals 450c3983b2SBen Grasand login accounting. 460c3983b2SBen GrasThese routines are 470c3983b2SBen Gras.Nx Ns -specific 480c3983b2SBen Grasand are not portable. 490c3983b2SBen GrasTheir use should be restricted. 500c3983b2SBen Gras.Pp 510c3983b2SBen GrasDeclarations for these functions may be obtained from the include file 520c3983b2SBen Gras.In util.h . 530c3983b2SBen GrasThe 540c3983b2SBen Gras.Nm 550c3983b2SBen Graslibrary and the associated functions are implemented within the 560c3983b2SBen Gras.Pa /usr/src/lib/libutil 570c3983b2SBen Grasdirectory. 580c3983b2SBen Gras.Sh LIST OF FUNCTIONS 590c3983b2SBen Gras.Bl -column ".Xr sockaddr_snprintf 3" -compact 600c3983b2SBen Gras.It Sy Name Description 610c3983b2SBen Gras.It Xr disklabel_dkcksum 3 Ta compute the checksum for a disklabel 620c3983b2SBen Gras.It Xr disklabel_scan 3 Ta scan a buffer for a valid disklabel 630c3983b2SBen Gras.It Xr forkpty 3 Ta tty utility function 640c3983b2SBen Gras.It Xr getbootfile 3 Ta get the name of the booted kernel file 650c3983b2SBen Gras.It Xr getlabeloffset 3 Ta get the sector number and offset of the disklabel 660c3983b2SBen Gras.It Xr getlabelsector 3 Ta get the sector number and offset of the disklabel 670c3983b2SBen Gras.It Xr getmaxpartitions 3 Ta get the maximum number of partitions allowed per disk 680c3983b2SBen Gras.It Xr getrawpartition 3 Ta get the system ``raw'' partition 690c3983b2SBen Gras.It Xr login 3 Ta login utility function 700c3983b2SBen Gras.It Xr login_cap 3 Ta query login.conf database about a user class 710c3983b2SBen Gras.It Xr login_close 3 Ta query login.conf database about a user class 720c3983b2SBen Gras.It Xr login_getcapbool 3 Ta query login.conf database about a user class 730c3983b2SBen Gras.It Xr login_getcapnum 3 Ta query login.conf database about a user class 740c3983b2SBen Gras.It Xr login_getcapsize 3 Ta query login.conf database about a user class 750c3983b2SBen Gras.It Xr login_getcapstr 3 Ta query login.conf database about a user class 760c3983b2SBen Gras.It Xr login_getcaptime 3 Ta query login.conf database about a user class 770c3983b2SBen Gras.It Xr login_getclass 3 Ta query login.conf database about a user class 780c3983b2SBen Gras.It Xr login_tty 3 Ta tty utility function 790c3983b2SBen Gras.It Xr loginx 3 Ta login utility function 800c3983b2SBen Gras.It Xr logout 3 Ta login utility function 810c3983b2SBen Gras.It Xr logoutx 3 Ta login utility function 820c3983b2SBen Gras.It Xr logwtmp 3 Ta login utility function 830c3983b2SBen Gras.It Xr logwtmpx 3 Ta login utility function 840c3983b2SBen Gras.It Xr opendisk 3 Ta open a disk partition 850c3983b2SBen Gras.It Xr openpty 3 Ta tty utility function 860c3983b2SBen Gras.It Xr pidfile 3 Ta write a daemon pid file 870c3983b2SBen Gras.It Xr pidlock 3 Ta locks based on files containing PIDs 880c3983b2SBen Gras.It Xr pw_abort 3 Ta passwd file update function 890c3983b2SBen Gras.It Xr pw_copy 3 Ta utility function for interactive passwd file updates 900c3983b2SBen Gras.It Xr pw_edit 3 Ta utility function for interactive passwd file updates 910c3983b2SBen Gras.It Xr pw_error 3 Ta utility function for interactive passwd file updates 920c3983b2SBen Gras.It Xr pw_getconf 3 Ta password encryption configuration access function 930c3983b2SBen Gras.It Xr pw_getprefix 3 Ta passwd file update function 940c3983b2SBen Gras.It Xr pw_init 3 Ta utility function for interactive passwd file updates 950c3983b2SBen Gras.It Xr pw_lock 3 Ta passwd file update function 960c3983b2SBen Gras.It Xr pw_mkdb 3 Ta passwd file update function 970c3983b2SBen Gras.It Xr pw_prompt 3 Ta utility function for interactive passwd file updates 980c3983b2SBen Gras.It Xr pw_scan 3 Ta utility function for interactive passwd file updates 990c3983b2SBen Gras.It Xr pw_setprefix 3 Ta passwd file update function 1000c3983b2SBen Gras.It Xr secure_path 3 Ta determine if a file appears to be ``secure'' 1010c3983b2SBen Gras.It Xr setclasscontext 3 Ta query login.conf database about a user class 1020c3983b2SBen Gras.It Xr setusercontext 3 Ta query login.conf database about a user class 1030c3983b2SBen Gras.It Xr snprintb 3 Ta bitmask output conversion 1040c3983b2SBen Gras.It Xr sockaddr_snprintf 3 Ta socket address formatting function 105*dba3562dSLionel Sambuc.It Xr strpct 3 Ta decimal percent formatter 1060c3983b2SBen Gras.It Xr ttyaction 3 Ta ttyaction utility function 1070c3983b2SBen Gras.It Xr ttylock 3 Ta locks based on files containing PIDs 1080c3983b2SBen Gras.It Xr ttymsg 3 Ta ttymsg utility function 1090c3983b2SBen Gras.It Xr ttyunlock 3 Ta locks based on files containing PIDs 1100c3983b2SBen Gras.El 1110c3983b2SBen Gras.Sh FILES 1120c3983b2SBen Gras.Bl -tag -width /usr/lib/libutil_p.a -compact 1130c3983b2SBen Gras.It Pa /usr/lib/libutil.a 1140c3983b2SBen Grasstatic util library 1150c3983b2SBen Gras.It Pa /usr/lib/libutil.so 1160c3983b2SBen Grasdynamic util library 1170c3983b2SBen Gras.It Pa /usr/lib/libutil_p.a 1180c3983b2SBen Grasstatic util library compiled for profiling 1190c3983b2SBen Gras.El 1200c3983b2SBen Gras.Sh SEE ALSO 1210c3983b2SBen Gras.Xr efun 3 , 1220c3983b2SBen Gras.Xr intro 3 123