1af8c0bceSMike Barcroft.\" Copyright (c) 2002 Kyle Martin. All rights reserved. 2af8c0bceSMike Barcroft.\" 3af8c0bceSMike Barcroft.\" Redistribution and use in source and binary forms, with or without 4af8c0bceSMike Barcroft.\" modification, are permitted provided that the following conditions 5af8c0bceSMike Barcroft.\" are met: 6af8c0bceSMike Barcroft.\" 1. Redistributions of source code must retain the above copyright 7af8c0bceSMike Barcroft.\" notice, this list of conditions and the following disclaimer. 8af8c0bceSMike Barcroft.\" 2. Redistributions in binary form must reproduce the above copyright 9af8c0bceSMike Barcroft.\" notice, this list of conditions and the following disclaimer in the 10af8c0bceSMike Barcroft.\" documentation and/or other materials provided with the distribution. 11af8c0bceSMike Barcroft.\" 12af8c0bceSMike Barcroft.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 13af8c0bceSMike Barcroft.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14af8c0bceSMike Barcroft.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15af8c0bceSMike Barcroft.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 16af8c0bceSMike Barcroft.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17af8c0bceSMike Barcroft.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18af8c0bceSMike Barcroft.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19af8c0bceSMike Barcroft.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20af8c0bceSMike Barcroft.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21af8c0bceSMike Barcroft.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22af8c0bceSMike Barcroft.\" SUCH DAMAGE. 23af8c0bceSMike Barcroft.\" 2486e1d472STim J. Robbins.Dd January 4, 2003 25af8c0bceSMike Barcroft.Dt ULIMIT 3 26af8c0bceSMike Barcroft.Os 27af8c0bceSMike Barcroft.Sh NAME 28af8c0bceSMike Barcroft.Nm ulimit 29af8c0bceSMike Barcroft.Nd get and set process limits 30af8c0bceSMike Barcroft.Sh LIBRARY 31af8c0bceSMike Barcroft.Lb libc 32af8c0bceSMike Barcroft.Sh SYNOPSIS 33af8c0bceSMike Barcroft.In ulimit.h 34af8c0bceSMike Barcroft.Ft long 35af8c0bceSMike Barcroft.Fn ulimit "int cmd" "..." 36af8c0bceSMike Barcroft.Sh DESCRIPTION 37af8c0bceSMike BarcroftThe 38af8c0bceSMike Barcroft.Fn ulimit 39af8c0bceSMike Barcroftfunction will get and set process limits. 40af8c0bceSMike BarcroftCurrently this is limited to the maximum file size. 41af8c0bceSMike BarcroftThe 42304d1f73SRuslan Ermilov.Fa cmd 432efeeba5SRuslan Ermilovargument is one of the following: 4486e1d472STim J. Robbins.Bl -tag -width ".Dv UL_GETFSIZE" 4586e1d472STim J. Robbins.It Dv UL_GETFSIZE 46af8c0bceSMike Barcroftwill return the maximum file size in units of 512 blocks of 47af8c0bceSMike Barcroftthe current process. 4886e1d472STim J. Robbins.It Dv UL_SETFSIZE 49af8c0bceSMike Barcroftwill attempt to set the maximum file size of the current 50af8c0bceSMike Barcroftprocess and its children with the second argument expressed as a long. 51af8c0bceSMike Barcroft.El 52af8c0bceSMike Barcroft.Sh RETURN VALUES 53af8c0bceSMike BarcroftUpon successful completion, 54af8c0bceSMike Barcroft.Fn ulimit 55af8c0bceSMike Barcroftreturns the value requested; 56304d1f73SRuslan Ermilovotherwise the value \-1 is returned and the global variable 575c564baeSRuslan Ermilov.Va errno 58af8c0bceSMike Barcroftis set to indicate the error. 59af8c0bceSMike Barcroft.Sh ERRORS 60af8c0bceSMike BarcroftThe 61af8c0bceSMike Barcroft.Fn ulimit 62af8c0bceSMike Barcroftfunction will fail if: 63af8c0bceSMike Barcroft.Bl -tag -width Er 64af8c0bceSMike Barcroft.It Bq Er EINVAL 65af8c0bceSMike BarcroftThe command specified was invalid. 66af8c0bceSMike Barcroft.It Bq Er EPERM 67af8c0bceSMike BarcroftThe limit specified to 68af8c0bceSMike Barcroft.Fn ulimit 69af8c0bceSMike Barcroftwould have raised the maximum limit value, 70af8c0bceSMike Barcroftand the caller is not the super-user. 71af8c0bceSMike Barcroft.El 72af8c0bceSMike Barcroft.Sh SEE ALSO 73af8c0bceSMike Barcroft.Xr getrlimit 2 74af8c0bceSMike Barcroft.Sh STANDARDS 75af8c0bceSMike BarcroftThe 76af8c0bceSMike Barcroft.Fn ulimit 77af8c0bceSMike Barcroftfunction conforms to 78af8c0bceSMike Barcroft.St -p1003.1-2001 . 79af8c0bceSMike Barcroft.Sh HISTORY 80af8c0bceSMike BarcroftThe 81af8c0bceSMike Barcroft.Fn ulimit 82af8c0bceSMike Barcroftfunction first appeared in 83af8c0bceSMike Barcroft.Fx 5.0 . 84af8c0bceSMike Barcroft.Sh BUGS 85af8c0bceSMike BarcroftThe 86af8c0bceSMike Barcroft.Fn ulimit 87af8c0bceSMike Barcroftfunction provides limited precision for 88af8c0bceSMike Barcroftsetting and retrieving process limits. 89af8c0bceSMike BarcroftIf there is a need for greater precision than the 90af8c0bceSMike Barcrofttype 91af8c0bceSMike Barcroft.Vt long 92af8c0bceSMike Barcroftprovides, the 93af8c0bceSMike Barcroft.Xr getrlimit 2 94af8c0bceSMike Barcroftand 95af8c0bceSMike Barcroft.Xr setrlimit 2 96af8c0bceSMike Barcroftfunctions should be considered. 97