14772483cSRuslan Ermilov.\" 24772483cSRuslan Ermilov.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved. 34772483cSRuslan Ermilov.\" 44772483cSRuslan Ermilov.\" Redistribution and use in source and binary forms, with or without 54772483cSRuslan Ermilov.\" modification, are permitted provided that the following conditions 64772483cSRuslan Ermilov.\" are met: 74772483cSRuslan Ermilov.\" 1. Redistributions of source code must retain the above copyright 84772483cSRuslan Ermilov.\" notice(s), this list of conditions and the following disclaimer as 94772483cSRuslan Ermilov.\" the first lines of this file unmodified other than the possible 104772483cSRuslan Ermilov.\" addition of one or more copyright notices. 114772483cSRuslan Ermilov.\" 2. Redistributions in binary form must reproduce the above copyright 124772483cSRuslan Ermilov.\" notice(s), this list of conditions and the following disclaimer in the 134772483cSRuslan Ermilov.\" documentation and/or other materials provided with the distribution. 144772483cSRuslan Ermilov.\" 154772483cSRuslan Ermilov.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 164772483cSRuslan Ermilov.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 174772483cSRuslan Ermilov.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 184772483cSRuslan Ermilov.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 194772483cSRuslan Ermilov.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 204772483cSRuslan Ermilov.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 214772483cSRuslan Ermilov.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 224772483cSRuslan Ermilov.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 234772483cSRuslan Ermilov.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 244772483cSRuslan Ermilov.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 254772483cSRuslan Ermilov.\" DAMAGE. 264772483cSRuslan Ermilov.\" 274772483cSRuslan Ermilov.Dd July 10, 2001 284772483cSRuslan Ermilov.Dt UIDINFO 9 294772483cSRuslan Ermilov.Os 304772483cSRuslan Ermilov.Sh NAME 314772483cSRuslan Ermilov.Nm uidinfo , 324772483cSRuslan Ermilov.Nm uihashinit , 334772483cSRuslan Ermilov.Nm uifind , 344772483cSRuslan Ermilov.Nm uihold , 354772483cSRuslan Ermilov.Nm uifree 364772483cSRuslan Ermilov.Nd "functions for managing UID information" 374772483cSRuslan Ermilov.Sh SYNOPSIS 384772483cSRuslan Ermilov.In sys/param.h 39f16b3c0dSChad David.In sys/proc.h 404772483cSRuslan Ermilov.In sys/resourcevar.h 414772483cSRuslan Ermilov.Ft void 424772483cSRuslan Ermilov.Fn uihashinit void 434772483cSRuslan Ermilov.Ft "struct uidinfo *" 444772483cSRuslan Ermilov.Fn uifind "uid_t uid" 454772483cSRuslan Ermilov.Ft void 464772483cSRuslan Ermilov.Fn uihold "struct uidinfo *uip" 474772483cSRuslan Ermilov.Ft void 484772483cSRuslan Ermilov.Fn uifree "struct uidinfo *uip" 494772483cSRuslan Ermilov.Sh DESCRIPTION 504772483cSRuslan ErmilovThe 514772483cSRuslan Ermilov.Nm 524772483cSRuslan Ermilovfamily of functions 534772483cSRuslan Ermilovis used to manage 544772483cSRuslan Ermilov.Vt uidinfo 554772483cSRuslan Ermilovstructures. 5602aadf0bSChad DavidEach 574772483cSRuslan Ermilov.Vt uidinfo 5802aadf0bSChad Davidstructure maintains per uid resource consumption counts, including the 5902aadf0bSChad Davidprocess count and socket buffer space usage. 604772483cSRuslan Ermilov.Pp 614772483cSRuslan ErmilovThe 624772483cSRuslan Ermilov.Fn uihashinit 634772483cSRuslan Ermilovfunction initializes the 644772483cSRuslan Ermilov.Vt uidinfo 6502aadf0bSChad Davidhash table and its mutex. 664772483cSRuslan ErmilovThis function should only be called during system initialization. 674772483cSRuslan Ermilov.Pp 684772483cSRuslan ErmilovThe 694772483cSRuslan Ermilov.Fn uifind 704772483cSRuslan Ermilovfunction looks up and returns the 714772483cSRuslan Ermilov.Vt uidinfo 7202aadf0bSChad Davidstructure for 734772483cSRuslan Ermilov.Fa uid . 7475aee0b9SRuslan ErmilovIf no 754772483cSRuslan Ermilov.Vt uidinfo 7602aadf0bSChad Davidstructure exists for 7702aadf0bSChad David.Fa uid , 7802aadf0bSChad Davida new structure will be allocated and initialized. 7975aee0b9SRuslan ErmilovThe 8075aee0b9SRuslan Ermilov.Nm 8175aee0b9SRuslan Ermilovhash mutex is acquired and released. 824772483cSRuslan Ermilov.Pp 834772483cSRuslan ErmilovThe 844772483cSRuslan Ermilov.Fn uihold 8502aadf0bSChad Davidfunction increases the reference count on 8602aadf0bSChad David.Fa uip . 8775aee0b9SRuslan Ermilov.Fa uip Ns 's 8802aadf0bSChad Davidlock is acquired and released. 894772483cSRuslan Ermilov.Pp 904772483cSRuslan ErmilovThe 914772483cSRuslan Ermilov.Fn uifree 9202aadf0bSChad Davidfunction decreases the reference count on 9302aadf0bSChad David.Fa uip , 9402aadf0bSChad Davidand if the count reaches 0 9502aadf0bSChad David.Fa uip 9602aadf0bSChad Davidis freed. 9775aee0b9SRuslan Ermilov.Fa uip Ns 's 9802aadf0bSChad Davidlock is acquired and release and the uidinfo hash mutex may be 9902aadf0bSChad Davidacquired and released. 1004772483cSRuslan Ermilov.Sh RETURN VALUES 10102aadf0bSChad David.Fn uifind 10202aadf0bSChad Davidreturns a pointer to an initialized 1034772483cSRuslan Ermilov.Vt uidinfo 10402aadf0bSChad Davidstructure, and should not fail. 1054772483cSRuslan Ermilov.Sh AUTHORS 106571dba6eSHiten PandyaThis manual page was written by 107*8a7314fcSBaptiste Daroussin.An Chad David Aq Mt davidc@acns.ab.ca . 108