/third_party/musl/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() 19 int ret = __syscall(SYS_prlimit64, 0, resource, rlim, 0); in __setrlimit() 21 k_rlim[0] = MIN(rlim->rlim_cur, MIN(-1UL, SYSCALL_RLIM_INFINITY)); in __setrlimit() 22 k_rlim[1] = MIN(rlim->rlim_max, MIN(-1UL, SYSCALL_RLIM_INFINITY)); in __setrlimit() 27 const struct rlimit *rlim; member 36 c->err = -__setrlimit(c->res, c->rlim); in do_setrlimit() 39 int setrlimit(int resource, const struct rlimit *rlim) in setrlimit() argument 41 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 10 int ret = syscall(SYS_prlimit64, 0, resource, 0, rlim); in getrlimit() 12 FIX(rlim->rlim_cur); in getrlimit() 13 FIX(rlim->rlim_max); in getrlimit() 19 rlim->rlim_cur = k_rlim[0] == -1UL ? RLIM_INFINITY : k_rlim[0]; in getrlimit() 20 rlim->rlim_max = k_rlim[1] == -1UL ? RLIM_INFINITY : k_rlim[1]; in getrlimit() 21 FIX(rlim->rlim_cur); in getrlimit() 22 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/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/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()
|
D | Gperf-trace.c | 221 struct rlimit rlim; in main() local 223 rlim.rlim_cur = RLIM_INFINITY; in main() 224 rlim.rlim_max = RLIM_INFINITY; in main() 225 setrlimit (RLIMIT_STACK, &rlim); in main()
|
D | Gperf-simple.c | 235 struct rlimit rlim; in main() local 237 rlim.rlim_cur = RLIM_INFINITY; in main() 238 rlim.rlim_max = RLIM_INFINITY; in main() 239 setrlimit (RLIMIT_STACK, &rlim); in main()
|
/third_party/ltp/testcases/kernel/syscalls/getrlimit/ |
D | getrlimit02.c | 23 static struct rlimit rlim; variable 28 struct rlimit *rlim; /* rlimit structure */ member 31 { EINVAL, "EINVAL", &rlim, RLIMIT_TOO_HIGH} 38 TEST(getrlimit(tc->res_type, tc->rlim)); in verify_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()
|
/third_party/grpc/test/core/iomgr/ |
D | fd_conservation_posix_test.cc | 29 struct rlimit rlim; in main() local 40 rlim.rlim_cur = rlim.rlim_max = 10; in main() 41 GPR_ASSERT(0 == setrlimit(RLIMIT_NOFILE, &rlim)); in main()
|
/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/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/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/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 | 208 struct rlimit rlim; in setup_rlimit() local 210 SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlim); in setup_rlimit() 211 rlim.rlim_cur = max_files; in setup_rlimit() 212 SAFE_SETRLIMIT(RLIMIT_NOFILE, &rlim); in setup_rlimit()
|