source: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/legacy/ulimit.c@ 337

Last change on this file since 337 was 337, checked in by coas-nagasima, 6 years ago

ASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 368 bytes
Line 
1#include <sys/resource.h>
2#include <ulimit.h>
3#include <stdarg.h>
4
5long ulimit(int cmd, ...)
6{
7 struct rlimit rl;
8 getrlimit(RLIMIT_FSIZE, &rl);
9 if (cmd == UL_SETFSIZE) {
10 long val;
11 va_list ap;
12 va_start(ap, cmd);
13 val = va_arg(ap, long);
14 va_end(ap);
15 rl.rlim_cur = 512ULL * val;
16 if (setrlimit(RLIMIT_FSIZE, &rl)) return -1;
17 }
18 return rl.rlim_cur / 512;
19}
Note: See TracBrowser for help on using the repository browser.