/third_party/musl/src/misc/ |
D | setrlimit.c | 10 static int __setrlimit(int resource, const struct rlimit *rlim) in __setrlimit() argument 15 tmp = *rlim; in __setrlimit() 18 rlim = &tmp; in __setrlimit() 21 k_rlim[0] = rlim->rlim_cur; in __setrlimit() 22 k_rlim[1] = rlim->rlim_max; in __setrlimit() 29 const struct rlimit *rlim; member 42 c->err = -__setrlimit(c->res, c->rlim); in do_setrlimit() 48 int setrlimit(int resource, const struct rlimit *rlim) in setrlimit() argument 51 struct ctx c = { .res = resource, .rlim = rlim, .err = -1 }; in setrlimit() 55 tmp = *rlim; in setrlimit() [all …]
|
D | getrlimit.c | 7 int getrlimit(int resource, struct rlimit *rlim) in getrlimit() argument 15 rlim->rlim_cur = k_rlim[0]; in getrlimit() 16 rlim->rlim_max = k_rlim[1]; in getrlimit() 21 int ret = syscall(SYS_prlimit64, 0, resource, 0, rlim); in getrlimit() 23 FIX(rlim->rlim_cur); in getrlimit() 24 FIX(rlim->rlim_max); in getrlimit() 30 rlim->rlim_cur = k_rlim[0] == -1UL ? RLIM_INFINITY : k_rlim[0]; in getrlimit() 31 rlim->rlim_max = k_rlim[1] == -1UL ? RLIM_INFINITY : k_rlim[1]; in getrlimit() 32 FIX(rlim->rlim_cur); in getrlimit() 33 FIX(rlim->rlim_max); in getrlimit()
|
/third_party/musl/porting/liteos_a/user/src/misc/ |
D | setrlimit.c | 9 static int __setrlimit(int resource, const struct rlimit *rlim) in __setrlimit() argument 14 tmp = *rlim; in __setrlimit() 17 rlim = &tmp; in __setrlimit() 20 k_rlim[0] = rlim->rlim_cur; in __setrlimit() 21 k_rlim[1] = rlim->rlim_max; in __setrlimit() 26 const struct rlimit *rlim; member 35 c->err = -__setrlimit(c->res, c->rlim); in do_setrlimit() 38 int setrlimit(int resource, const struct rlimit *rlim) in setrlimit() argument 40 struct ctx c = { .res = resource, .rlim = rlim, .err = -1 }; in setrlimit()
|
D | getrlimit.c | 7 int getrlimit(int resource, struct rlimit *rlim) in getrlimit() argument 14 rlim->rlim_cur = k_rlim[0]; in getrlimit() 15 rlim->rlim_max = k_rlim[1]; in getrlimit()
|
/third_party/ltp/testcases/kernel/syscalls/setrlimit/ |
D | setrlimit01.c | 53 static struct rlimit save_rlim, rlim, rlim1; variable 89 rlim.rlim_cur = 100; in test1() 90 rlim.rlim_max = 100; in test1() 92 TEST(setrlimit(RLIMIT_NOFILE, &rlim)); in test1() 143 rlim.rlim_cur = 10; in test2() 144 rlim.rlim_max = 10; in test2() 145 if ((setrlimit(RLIMIT_FSIZE, &rlim)) == -1) in test2() 198 rlim.rlim_cur = 10; in test3() 199 rlim.rlim_max = 10; in test3() 201 TEST(setrlimit(RLIMIT_NPROC, &rlim)); in test3() [all …]
|
D | setrlimit02.c | 15 static struct rlimit rlim; variable 19 struct rlimit *rlim; member 22 {-1, &rlim, EINVAL}, 23 {RLIMIT_NOFILE, &rlim, EPERM} 30 TEST(setrlimit(tc->resource, tc->rlim)); in verify_setrlimit() 53 SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim); in setup() 54 rlim.rlim_max++; in setup()
|
D | setrlimit04.c | 28 struct rlimit rlim; in test_setrlimit() local 31 rlim.rlim_cur = STACK_LIMIT; in test_setrlimit() 32 rlim.rlim_max = STACK_LIMIT; in test_setrlimit() 34 SAFE_SETRLIMIT(RLIMIT_STACK, &rlim); in test_setrlimit()
|
/third_party/ltp/testcases/kernel/syscalls/waitid/ |
D | waitid10.c | 49 struct rlimit rlim; in setup() local 52 SAFE_GETRLIMIT(RLIMIT_CORE, &rlim); in setup() 55 if (rlim.rlim_cur) in setup() 58 if (!rlim.rlim_max) { in setup() 65 rlim.rlim_cur, rlim.rlim_max); in setup() 67 rlim.rlim_cur = rlim.rlim_max; in setup() 68 SAFE_SETRLIMIT(RLIMIT_CORE, &rlim); in setup()
|
/third_party/ltp/testcases/kernel/syscalls/abort/ |
D | abort01.c | 74 struct rlimit rlim; in setup() local 77 SAFE_GETRLIMIT(RLIMIT_CORE, &rlim); in setup() 79 if (rlim.rlim_max < MIN_RLIMIT_CORE) { in setup() 82 rlim.rlim_max, MIN_RLIMIT_CORE); in setup() 85 rlim.rlim_max = MIN_RLIMIT_CORE; in setup() 87 if (rlim.rlim_cur < MIN_RLIMIT_CORE) { in setup() 88 rlim.rlim_cur = MIN_RLIMIT_CORE; in setup() 89 SAFE_SETRLIMIT(RLIMIT_CORE, &rlim); in setup()
|
/third_party/ltp/testcases/kernel/syscalls/kill/ |
D | kill11.c | 106 struct rlimit rlim; in setup() local 108 SAFE_GETRLIMIT(RLIMIT_CORE, &rlim); in setup() 110 if (rlim.rlim_max < MIN_RLIMIT_CORE) { in setup() 113 rlim.rlim_max, MIN_RLIMIT_CORE); in setup() 116 rlim.rlim_max = MIN_RLIMIT_CORE; in setup() 118 if (rlim.rlim_cur < MIN_RLIMIT_CORE) { in setup() 120 rlim.rlim_cur = MIN_RLIMIT_CORE; in setup() 121 SAFE_SETRLIMIT(RLIMIT_CORE, &rlim); in setup()
|
/third_party/libunwind/libunwind/tests/ |
D | test-mem.c | 89 struct rlimit rlim; in main() local 96 rlim.rlim_cur = 0; in main() 97 rlim.rlim_max = RLIM_INFINITY; in main() 98 setrlimit (RLIMIT_DATA, &rlim); in main() 99 setrlimit (RLIMIT_AS, &rlim); in main()
|
D | test-reg-state.c | 120 struct rlimit rlim; in main() local 127 rlim.rlim_cur = 0; in main() 128 rlim.rlim_max = RLIM_INFINITY; in main() 129 setrlimit (RLIMIT_DATA, &rlim); in main()
|
/third_party/ltp/testcases/kernel/syscalls/getrlimit/ |
D | getrlimit03.c | 62 static int getrlimit_u64(int resource, struct rlimit64 *rlim) in getrlimit_u64() argument 64 return tst_syscall(__NR_prlimit64, 0, resource, NULL, rlim); in getrlimit_u64() 78 static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim) in getrlimit_ulong() argument 80 return syscall(__NR_getrlimit_ulong, resource, rlim); in getrlimit_ulong() 91 static int getrlimit_long(int resource, struct rlimit_long *rlim) in getrlimit_long() argument 93 return syscall(__NR_getrlimit, resource, rlim); in getrlimit_long()
|
D | getrlimit02.c | 23 static struct rlimit rlim; variable 28 struct rlimit *rlim; member 32 {EINVAL, "invalid resource type", &rlim, INVALID_RES_TYPE} 39 TST_EXP_FAIL(getrlimit(tc->res_type, tc->rlim), in verify_getrlimit()
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/ |
D | 15-1.c | 30 struct rlimit rlim; in set_nonroot() local 44 rlim.rlim_cur = 0; in set_nonroot() 45 rlim.rlim_max = 0; in set_nonroot() 46 if ((ret = setrlimit(RLIMIT_MEMLOCK, &rlim)) != 0) in set_nonroot()
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/ |
D | 15-1.c | 30 struct rlimit rlim; in set_nonroot() local 44 rlim.rlim_cur = 0; in set_nonroot() 45 rlim.rlim_max = 0; in set_nonroot() 46 if ((ret = setrlimit(RLIMIT_MEMLOCK, &rlim)) != 0) in set_nonroot()
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/ |
D | 12-1.c | 33 struct rlimit rlim; in set_nonroot() local 54 rlim.rlim_cur = 0; in set_nonroot() 55 rlim.rlim_max = 0; in set_nonroot() 56 if ((ret = setrlimit(RLIMIT_MEMLOCK, &rlim)) != 0) in set_nonroot()
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/ |
D | 12-1.c | 34 struct rlimit rlim; in set_nonroot() local 55 rlim.rlim_cur = 0; in set_nonroot() 56 rlim.rlim_max = 0; in set_nonroot() 57 if ((ret = setrlimit(RLIMIT_MEMLOCK, &rlim)) != 0) in set_nonroot()
|
/third_party/ltp/include/old/ |
D | safe_macros.h | 287 void (cleanup_fn)(void), int resource, struct rlimit *rlim) in safe_getrlimit() argument 291 rval = getrlimit(resource, rlim); in safe_getrlimit() 296 file, lineno, resource, rlim); in safe_getrlimit() 301 #define SAFE_GETRLIMIT(cleanup_fn, resource, rlim) \ argument 302 safe_getrlimit(__FILE__, __LINE__, (cleanup_fn), (resource), (rlim)) 305 void (cleanup_fn)(void), int resource, const struct rlimit *rlim) in safe_setrlimit() argument 309 rval = setrlimit(resource, rlim); in safe_setrlimit() 314 file, lineno, resource, rlim); in safe_setrlimit() 319 #define SAFE_SETRLIMIT(cleanup_fn, resource, rlim) \ argument 320 safe_setrlimit(__FILE__, __LINE__, (cleanup_fn), (resource), (rlim))
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/ |
D | 24-2.c | 43 struct rlimit rlim; in main() local 63 if (getrlimit(RLIMIT_AS, &rlim) == -1) { in main() 67 printf("available memory: %lu\n", rlim.rlim_cur); in main() 77 len = rlim.rlim_cur; in main()
|
D | 18-1.c | 79 struct rlimit rlim = {.rlim_max = RLIM_INFINITY }; in main() local 90 rlim.rlim_cur = memlock_size; in main() 95 if (setrlimit(RLIMIT_MEMLOCK, &rlim) == -1) { in main()
|
/third_party/node/deps/v8/src/base/ |
D | sys-info.cc | 119 struct rlimit rlim; in AmountOfVirtualMemory() 120 int result = getrlimit(RLIMIT_DATA, &rlim); in AmountOfVirtualMemory() 124 return (rlim.rlim_cur == RLIM_INFINITY) ? 0 : rlim.rlim_cur; in AmountOfVirtualMemory()
|
/third_party/ltp/testcases/kernel/syscalls/mq_open/ |
D | mq_open01.c | 24 static struct rlimit rlim; variable 179 if (rlim.rlim_cur > 0) { in set_rlimit() 182 r.rlim_max = rlim.rlim_max; in set_rlimit() 189 SAFE_SETRLIMIT(RLIMIT_NOFILE, &rlim); in restore_rlimit() 196 SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim); in setup()
|
/third_party/ltp/testcases/kernel/syscalls/fanotify/ |
D | fanotify17.c | 206 struct rlimit rlim; in setup_rlimit() local 208 SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim); in setup_rlimit() 209 rlim.rlim_cur = max_files; in setup_rlimit() 210 SAFE_SETRLIMIT(RLIMIT_NOFILE, &rlim); in setup_rlimit()
|
/third_party/ltp/include/ |
D | tst_safe_macros.h | 447 int resource, struct rlimit *rlim) in safe_getrlimit() argument 451 rval = getrlimit(resource, rlim); in safe_getrlimit() 455 "getrlimit(%d,%p) failed", resource, rlim); in safe_getrlimit() 459 rlim, rval); in safe_getrlimit() 464 #define SAFE_GETRLIMIT(resource, rlim) \ argument 465 safe_getrlimit(__FILE__, __LINE__, (resource), (rlim)) 468 int resource, const struct rlimit *rlim) in safe_setrlimit() argument 472 rval = setrlimit(resource, rlim); in safe_setrlimit() 476 "setrlimit(%d,%p) failed", resource, rlim); in safe_setrlimit() 480 rlim, rval); in safe_setrlimit() [all …]
|