logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

ulimit.3p (3853B)


  1. '\" et
  2. .TH ULIMIT "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. ulimit
  12. \(em get and set process limits
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <ulimit.h>
  17. .P
  18. long ulimit(int \fIcmd\fP, ...);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIulimit\fR()
  23. function shall control process limits. The process limits that can be
  24. controlled by this function include the maximum size of a single file
  25. that can be written (this is equivalent to using
  26. \fIsetrlimit\fR()
  27. with RLIMIT_FSIZE). The
  28. .IR cmd
  29. values, defined in
  30. .IR <ulimit.h> ,
  31. include:
  32. .IP UL_GETFSIZE 12
  33. Return the file size limit (RLIMIT_FSIZE) of the process. The limit
  34. shall be in units of 512-byte blocks and shall be inherited by child
  35. processes. Files of any size can be read. The return value shall be the
  36. integer part of the soft file size limit divided by 512. If the result
  37. cannot be represented as a
  38. .BR long ,
  39. the result is unspecified.
  40. .IP UL_SETFSIZE 12
  41. Set the file size limit for output operations of the process to the
  42. value of the second argument, taken as a
  43. .BR long ,
  44. multiplied by 512. If the result would overflow an
  45. .BR rlim_t ,
  46. the actual value set is unspecified. Any process may decrease its own
  47. limit, but only a process with appropriate privileges may increase the
  48. limit. The return value shall be the integer part of the new file size
  49. limit divided by 512.
  50. .P
  51. The
  52. \fIulimit\fR()
  53. function shall not change the setting of
  54. .IR errno
  55. if successful.
  56. .P
  57. As all return values are permissible in a successful situation, an
  58. application wishing to check for error situations should set
  59. .IR errno
  60. to 0, then call
  61. \fIulimit\fR(),
  62. and, if it returns \-1, check to see if
  63. .IR errno
  64. is non-zero.
  65. .SH "RETURN VALUE"
  66. Upon successful completion,
  67. \fIulimit\fR()
  68. shall return the value of the requested limit. Otherwise, \-1
  69. shall be returned and
  70. .IR errno
  71. set to indicate the error.
  72. .SH ERRORS
  73. The
  74. \fIulimit\fR()
  75. function shall fail and the limit shall be unchanged if:
  76. .TP
  77. .BR EINVAL
  78. The
  79. .IR cmd
  80. argument is not valid.
  81. .TP
  82. .BR EPERM
  83. A process not having appropriate privileges attempts to increase its
  84. file size limit.
  85. .LP
  86. .IR "The following sections are informative."
  87. .SH EXAMPLES
  88. None.
  89. .SH "APPLICATION USAGE"
  90. Since the
  91. \fIulimit\fR()
  92. function uses type
  93. .BR long
  94. rather than
  95. .BR rlim_t ,
  96. this function is not sufficient for file sizes on many current systems.
  97. Applications should use the
  98. \fIgetrlimit\fR()
  99. or
  100. \fIsetrlimit\fR()
  101. functions instead of the obsolescent
  102. \fIulimit\fR()
  103. function.
  104. .SH RATIONALE
  105. None.
  106. .SH "FUTURE DIRECTIONS"
  107. The
  108. \fIulimit\fR()
  109. function may be removed in a future version.
  110. .SH "SEE ALSO"
  111. .IR "\fIexec\fR\^",
  112. .IR "\fIgetrlimit\fR\^(\|)",
  113. .IR "\fIwrite\fR\^(\|)"
  114. .P
  115. The Base Definitions volume of POSIX.1\(hy2017,
  116. .IR "\fB<ulimit.h>\fP"
  117. .\"
  118. .SH COPYRIGHT
  119. Portions of this text are reprinted and reproduced in electronic form
  120. from IEEE Std 1003.1-2017, Standard for Information Technology
  121. -- Portable Operating System Interface (POSIX), The Open Group Base
  122. Specifications Issue 7, 2018 Edition,
  123. Copyright (C) 2018 by the Institute of
  124. Electrical and Electronics Engineers, Inc and The Open Group.
  125. In the event of any discrepancy between this version and the original IEEE and
  126. The Open Group Standard, the original IEEE and The Open Group Standard
  127. is the referee document. The original Standard can be obtained online at
  128. http://www.opengroup.org/unix/online.html .
  129. .PP
  130. Any typographical or formatting errors that appear
  131. in this page are most likely
  132. to have been introduced during the conversion of the source files to
  133. man page format. To report such errors, see
  134. https://www.kernel.org/doc/man-pages/reporting_bugs.html .