source: azure_iot_hub/trunk/musl-1.1.18/src/legacy/ulimit.c@ 388

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

Azure IoT Hub Device C SDK を使ったサンプルの追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-csrc
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.