MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl/samples/unix/main.cpp:9–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include <sys/resource.h>
8
9int main(void)
10{
11 struct rlimit rlim, rlim_new;
12 char buf[256];
13
14 acl_chroot_uid(NULL, "zsx");
15
16 printf("curr: %s\r\n", getcwd(buf, sizeof(buf)));
17
18 if (getrlimit(RLIMIT_CORE, &rlim)==0) {
19 rlim_new.rlim_cur = rlim_new.rlim_max = RLIM_INFINITY;
20 if (setrlimit(RLIMIT_CORE, &rlim_new) != 0) {
21 /* failed. try raising just to the old max */
22 rlim_new.rlim_cur = rlim_new.rlim_max =
23 rlim.rlim_max;
24 if (setrlimit(RLIMIT_CORE, &rlim_new) != 0)
25 printf("set core limit error: %s\n", acl_last_serror());
26 else
27 printf("set core limit ok\n");
28 }
29 else
30 printf("2 set core limit ok\n");
31 }
32 assert(0);
33 return (0);
34}

Callers

nothing calls this directly

Calls 2

acl_chroot_uidFunction · 0.85
acl_last_serrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…