Home
last modified time | relevance | path

Searched refs:rlim (Results 1 – 25 of 73) sorted by relevance

123

/external/strace/tests/
Dpipe_maxfd.c48 struct rlimit rlim; in pipe_maxfd() local
49 if (getrlimit(RLIMIT_NOFILE, &rlim)) in pipe_maxfd()
51 if (rlim.rlim_cur < rlim.rlim_max) { in pipe_maxfd()
53 rlim_new.rlim_cur = rlim_new.rlim_max = rlim.rlim_max; in pipe_maxfd()
55 rlim.rlim_cur = rlim.rlim_max; in pipe_maxfd()
61 int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < INT_MAX) in pipe_maxfd()
62 ? rlim.rlim_cur - 1 : INT_MAX; in pipe_maxfd()
/external/strace/tests-m32/
Dpipe_maxfd.c48 struct rlimit rlim; in pipe_maxfd() local
49 if (getrlimit(RLIMIT_NOFILE, &rlim)) in pipe_maxfd()
51 if (rlim.rlim_cur < rlim.rlim_max) { in pipe_maxfd()
53 rlim_new.rlim_cur = rlim_new.rlim_max = rlim.rlim_max; in pipe_maxfd()
55 rlim.rlim_cur = rlim.rlim_max; in pipe_maxfd()
61 int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < INT_MAX) in pipe_maxfd()
62 ? rlim.rlim_cur - 1 : INT_MAX; in pipe_maxfd()
/external/strace/tests-mx32/
Dpipe_maxfd.c48 struct rlimit rlim; in pipe_maxfd() local
49 if (getrlimit(RLIMIT_NOFILE, &rlim)) in pipe_maxfd()
51 if (rlim.rlim_cur < rlim.rlim_max) { in pipe_maxfd()
53 rlim_new.rlim_cur = rlim_new.rlim_max = rlim.rlim_max; in pipe_maxfd()
55 rlim.rlim_cur = rlim.rlim_max; in pipe_maxfd()
61 int max_fd = (rlim.rlim_cur > 0 && rlim.rlim_cur < INT_MAX) in pipe_maxfd()
62 ? rlim.rlim_cur - 1 : INT_MAX; in pipe_maxfd()
/external/ltp/testcases/kernel/syscalls/setrlimit/
Dsetrlimit01.c53 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()
199 rlim.rlim_cur = 10; in test3()
200 rlim.rlim_max = 10; in test3()
202 TEST(setrlimit(RLIMIT_NPROC, &rlim)); in test3()
[all …]
Dsetrlimit02.c15 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()
Dsetrlimit04.c28 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()
/external/linux-kselftest/tools/testing/selftests/powerpc/ptrace/
Dcore-pkey.c76 struct rlimit rlim; in increase_core_file_limit() local
79 ret = getrlimit(RLIMIT_CORE, &rlim); in increase_core_file_limit()
82 if (rlim.rlim_cur != RLIM_INFINITY && rlim.rlim_cur < CORE_FILE_LIMIT) { in increase_core_file_limit()
83 rlim.rlim_cur = CORE_FILE_LIMIT; in increase_core_file_limit()
85 if (rlim.rlim_max != RLIM_INFINITY && in increase_core_file_limit()
86 rlim.rlim_max < CORE_FILE_LIMIT) in increase_core_file_limit()
87 rlim.rlim_max = CORE_FILE_LIMIT; in increase_core_file_limit()
89 ret = setrlimit(RLIMIT_CORE, &rlim); in increase_core_file_limit()
93 ret = getrlimit(RLIMIT_FSIZE, &rlim); in increase_core_file_limit()
96 if (rlim.rlim_cur != RLIM_INFINITY && rlim.rlim_cur < CORE_FILE_LIMIT) { in increase_core_file_limit()
[all …]
/external/strace/
Dresource.c60 } rlim; in print_rlimit64() local
62 if (!umove_or_printaddr(tcp, addr, &rlim)) { in print_rlimit64()
63 tprintf("{rlim_cur=%s,", sprint_rlim64(rlim.rlim_cur)); in print_rlimit64()
64 tprintf(" rlim_max=%s}", sprint_rlim64(rlim.rlim_max)); in print_rlimit64()
91 } rlim; in print_rlimit32() local
93 if (!umove_or_printaddr(tcp, addr, &rlim)) { in print_rlimit32()
94 tprintf("{rlim_cur=%s,", sprint_rlim32(rlim.rlim_cur)); in print_rlimit32()
95 tprintf(" rlim_max=%s}", sprint_rlim32(rlim.rlim_max)); in print_rlimit32()
/external/libchrome/base/memory/
Dshared_memory_helper.cc108 struct rlimit rlim; in PrepareMapFile() local
109 if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) { in PrepareMapFile()
110 original_fd_limit = rlim.rlim_cur; in PrepareMapFile()
111 if (rlim.rlim_max > rlim.rlim_cur) { in PrepareMapFile()
113 rlim.rlim_cur = rlim.rlim_max; in PrepareMapFile()
114 if (setrlimit(RLIMIT_NOFILE, &rlim) != 0) { in PrepareMapFile()
/external/blktrace/btt/
Dmisc.c88 struct rlimit rlim; in increase_limit() local
91 if (!getrlimit(resource, &rlim)) { in increase_limit()
92 rlim.rlim_cur += increase; in increase_limit()
93 if (rlim.rlim_cur >= rlim.rlim_max) in increase_limit()
94 rlim.rlim_max = rlim.rlim_cur + increase; in increase_limit()
96 if (!setrlimit(resource, &rlim)) in increase_limit()
/external/compiler-rt/test/asan/TestCases/Linux/
Dstack-overflow-recovery-mode.cc19 struct rlimit rlim; in LimitStackAndReexec() local
20 int res = getrlimit(RLIMIT_STACK, &rlim); in LimitStackAndReexec()
22 if (rlim.rlim_cur == RLIM_INFINITY) { in LimitStackAndReexec()
23 rlim.rlim_cur = 256 * 1024; in LimitStackAndReexec()
24 res = setrlimit(RLIMIT_STACK, &rlim); in LimitStackAndReexec()
Dstack-overflow-sigbus.cc29 struct rlimit rlim; in LimitStackAndReexec() local
30 int res = getrlimit(RLIMIT_STACK, &rlim); in LimitStackAndReexec()
32 if (rlim.rlim_cur == RLIM_INFINITY) { in LimitStackAndReexec()
33 rlim.rlim_cur = 256 * 1024; in LimitStackAndReexec()
34 res = setrlimit(RLIMIT_STACK, &rlim); in LimitStackAndReexec()
/external/ltp/testcases/kernel/syscalls/abort/
Dabort01.c69 struct rlimit rlim; in setup() local
72 SAFE_GETRLIMIT(RLIMIT_CORE, &rlim); in setup()
73 if (rlim.rlim_cur < MIN_RLIMIT_CORE) { in setup()
74 rlim.rlim_cur = MIN_RLIMIT_CORE; in setup()
75 SAFE_SETRLIMIT(RLIMIT_CORE, &rlim); in setup()
/external/libunwind/tests/
Dtest-mem.c89 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()
/external/honggfuzz/
Dhonggfuzz.c92 struct rlimit rlim; in setupRLimits() local
93 if (getrlimit(RLIMIT_NOFILE, &rlim) == -1) { in setupRLimits()
97 if (rlim.rlim_cur >= 1024) { in setupRLimits()
100 if (rlim.rlim_max < 1024) { in setupRLimits()
101 LOG_E("RLIMIT_NOFILE max limit < 1024 (%zu). Expect troubles!", (size_t)rlim.rlim_max); in setupRLimits()
104 rlim.rlim_cur = MIN(1024, rlim.rlim_max); // we don't need more in setupRLimits()
105 if (setrlimit(RLIMIT_NOFILE, &rlim) == -1) { in setupRLimits()
106 PLOG_E("Couldn't setrlimit(RLIMIT_NOFILE, cur=%zu/max=%zu)", (size_t)rlim.rlim_cur, in setupRLimits()
107 (size_t)rlim.rlim_max); in setupRLimits()
/external/igt-gpu-tools/benchmarks/
Dprime_lookup.c129 struct rlimit rlim; in allow_files() local
142 if (getrlimit(RLIMIT_NOFILE, &rlim)) in allow_files()
146 (long)rlim.rlim_cur, min); in allow_files()
148 if (rlim.rlim_cur > min) in allow_files()
151 rlim.rlim_cur = min; in allow_files()
152 rlim.rlim_max = min; in allow_files()
153 return setrlimit(RLIMIT_NOFILE, &rlim) == 0; in allow_files()
/external/grpc-grpc/test/core/iomgr/
Dfd_conservation_posix_test.cc29 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()
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/
D15-1.c30 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()
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlockall/
D15-1.c30 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()
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/
D12-1.c33 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()
/external/ltp/testcases/kernel/syscalls/getrlimit/
Dgetrlimit03.c56 static int getrlimit_u64(int resource, struct rlimit64 *rlim) in getrlimit_u64() argument
58 return tst_syscall(__NR_prlimit64, 0, resource, NULL, rlim); in getrlimit_u64()
72 static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim) in getrlimit_ulong() argument
74 return syscall(__NR_getrlimit_ulong, resource, rlim); in getrlimit_ulong()
84 static int getrlimit_long(int resource, struct rlimit_long *rlim) in getrlimit_long() argument
86 return syscall(__NR_getrlimit, resource, rlim); in getrlimit_long()
Dgetrlimit02.c83 static struct rlimit rlim; variable
87 struct rlimit *rlim; /* rlimit structure */ member
97 EINVAL, "EINVAL", &rlim, RLIMIT_TOO_HIGH}
122 testcases[i].rlim)); in main()
/external/ltp/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/
D12-1.c34 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()
/external/compiler-rt/test/asan/TestCases/Posix/
Dstack-overflow.cc91 struct rlimit rlim; in LimitStackAndReexec() local
92 int res = getrlimit(RLIMIT_STACK, &rlim); in LimitStackAndReexec()
94 if (rlim.rlim_cur == RLIM_INFINITY) { in LimitStackAndReexec()
95 rlim.rlim_cur = 256 * 1024; in LimitStackAndReexec()
96 res = setrlimit(RLIMIT_STACK, &rlim); in LimitStackAndReexec()
/external/libevent/
Dbufferevent_ratelim.c565 struct bufferevent_rate_limit *rlim; in bufferevent_set_rate_limit() local
575 rlim = bevp->rate_limiting; in bufferevent_set_rate_limit()
576 rlim->cfg = NULL; in bufferevent_set_rate_limit()
579 if (event_initialized(&rlim->refill_bucket_event)) in bufferevent_set_rate_limit()
580 event_del(&rlim->refill_bucket_event); in bufferevent_set_rate_limit()
595 rlim = mm_calloc(1, sizeof(struct bufferevent_rate_limit)); in bufferevent_set_rate_limit()
596 if (!rlim) in bufferevent_set_rate_limit()
598 bevp->rate_limiting = rlim; in bufferevent_set_rate_limit()
600 rlim = bevp->rate_limiting; in bufferevent_set_rate_limit()
602 reinit = rlim->cfg != NULL; in bufferevent_set_rate_limit()
[all …]

123