/kernel/liteos_a/testsuites/unittest/fuzz/ |
H A D | getrlimit_fuzzer.cpp | 37 struct rlimit fa; in TestGetrlimit() 43 char *datainput = DT_SetGetFixBlob(&g_Element[1], sizeof(struct rlimit), sizeof(struct rlimit), (char *)&fa); in TestGetrlimit() 44 getrlimit(resource, (struct rlimit *)datainput); in TestGetrlimit()
|
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/mm/ |
H A D | stack_expansion_ldst.c | 161 // We should be able to access anywhere within the rlimit in test_one_type() 167 // But if we go past the rlimit it should fail in test_one_type() 174 struct rlimit rlimit; in test() local 177 getrlimit(RLIMIT_STACK, &rlimit); in test() 178 printf("Stack rlimit is 0x%lx\n", rlimit.rlim_cur); in test() 181 test_one_type(LOAD, page_size, rlimit.rlim_cur); in test() 183 test_one_type(STORE, page_size, rlimit.rlim_cur); in test()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/mm/ |
H A D | stack_expansion_ldst.c | 161 // We should be able to access anywhere within the rlimit in test_one_type() 167 // But if we go past the rlimit it should fail in test_one_type() 174 struct rlimit rlimit; in test() local 177 getrlimit(RLIMIT_STACK, &rlimit); in test() 178 printf("Stack rlimit is 0x%lx\n", rlimit.rlim_cur); in test() 181 test_one_type(LOAD, page_size, rlimit.rlim_cur); in test() 183 test_one_type(STORE, page_size, rlimit.rlim_cur); in test()
|
/kernel/linux/linux-5.10/arch/powerpc/mm/ |
H A D | mmap.c | 28 static inline int mmap_is_legacy(struct rlimit *rlim_stack) in mmap_is_legacy() 66 struct rlimit *rlim_stack) in mmap_base() 187 struct rlimit *rlim_stack) in radix__arch_pick_mmap_layout() 201 struct rlimit *rlim_stack); 207 void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) in arch_pick_mmap_layout()
|
/kernel/linux/linux-6.6/tools/testing/selftests/core/ |
H A D | close_range_test.c | 248 struct rlimit rlimit; in TEST() local 271 ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlimit)); in TEST() 272 rlimit.rlim_cur = 25; in TEST() 273 ASSERT_EQ(0, setrlimit(RLIMIT_NOFILE, &rlimit)); in TEST() 316 struct rlimit rlimit; in TEST() local 339 ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlimit)); in TEST() 340 rlimit.rlim_cur = 25; in TEST() 341 ASSERT_EQ(0, setrlimit(RLIMIT_NOFILE, &rlimit)); in TEST() [all...] |
/kernel/liteos_a/compat/posix/src/ |
H A D | misc.c | 162 int getrlimit(int resource, struct rlimit *rlim) in getrlimit() 166 struct rlimit *resourceLimit = pcb->resourceLimit; in getrlimit() 195 int setrlimit(int resource, const struct rlimit *rlim) in setrlimit() 198 struct rlimit *resourceLimit = NULL; in setrlimit() 220 resourceLimit = LOS_MemAlloc((VOID *)m_aucSysMem0, RLIM_NLIMITS * sizeof(struct rlimit)); in setrlimit()
|
/kernel/linux/linux-5.10/include/linux/ |
H A D | resource.h | 12 struct rlimit *new_rlim, struct rlimit *old_rlim);
|
/kernel/liteos_a/testsuites/unittest/libc/misc/full/ |
H A D | misc_test_010.cpp | 36 int rlimit = 512; in TestCase() local 39 ICUNIT_ASSERT_EQUAL(ret, rlimit, ret); in TestCase()
|
H A D | misc_test_012.cpp | 36 struct rlimit rlim1; in TestCase() 37 struct rlimit rlim2 = {10, 10}; in TestCase()
|
/kernel/liteos_a/syscall/ |
H A D | misc_syscall.c | 249 struct rlimit lim = { 0 }; in SysUgetrlimit() 256 ret = LOS_ArchCopyToUser(k_rlim, &lim, sizeof(struct rlimit)); in SysUgetrlimit() 267 struct rlimit lim; in SysSetrlimit() 273 ret = LOS_ArchCopyFromUser(&lim, k_rlim, sizeof(struct rlimit)); in SysSetrlimit()
|
/kernel/linux/linux-5.10/security/apparmor/include/ |
H A D | resource.h | 21 /* struct aa_rlimit - rlimit settings for the profile 23 * @limits: rlimit values that override task limits 30 struct rlimit limits[RLIM_NLIMITS]; 37 unsigned int resource, struct rlimit *new_rlim);
|
/kernel/linux/linux-6.6/security/apparmor/include/ |
H A D | resource.h | 21 /* struct aa_rlimit - rlimit settings for the profile 23 * @limits: rlimit values that override task limits 30 struct rlimit limits[RLIM_NLIMITS]; 38 unsigned int resource, struct rlimit *new_rlim);
|
/kernel/linux/linux-5.10/drivers/hwmon/pmbus/ |
H A D | lm25066.c | 231 u16 rlimit; /* Maximum register value */ member 395 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 400 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 407 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 416 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 424 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 482 data->rlimit = 0x0fff; in lm25066_probe() 486 data->rlimit = 0x0fff; in lm25066_probe()
|
/kernel/linux/linux-6.6/drivers/hwmon/pmbus/ |
H A D | lm25066.c | 232 u16 rlimit; /* Maximum register value */ member 394 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 398 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 404 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 412 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 419 word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); in lm25066_write_word_data() 512 data->rlimit = 0x0fff; in lm25066_probe() 516 data->rlimit = 0x0fff; in lm25066_probe()
|
/kernel/linux/linux-6.6/kernel/ |
H A D | ucount.c | 270 long new = atomic_long_add_return(v, &iter->rlimit[type]); in inc_rlimit_ucounts() 285 long dec = atomic_long_sub_return(v, &iter->rlimit[type]); in dec_rlimit_ucounts() 298 long dec = atomic_long_sub_return(1, &iter->rlimit[type]); in do_dec_rlimit_put_ucounts() 319 long new = atomic_long_add_return(1, &iter->rlimit[type]); in inc_rlimit_get_ucounts() 327 * the rlimit count was previously 0. in inc_rlimit_get_ucounts() 336 dec = atomic_long_sub_return(1, &iter->rlimit[type]); in inc_rlimit_get_ucounts() 343 bool is_rlimit_overlimit(struct ucounts *ucounts, enum rlimit_type type, unsigned long rlimit) in is_rlimit_overlimit() argument 346 long max = rlimit; in is_rlimit_overlimit() 347 if (rlimit > LONG_MAX) in is_rlimit_overlimit()
|
/kernel/linux/linux-5.10/arch/x86/mm/ |
H A D | mmap.c | 83 struct rlimit *rlim_stack) in mmap_base() 120 struct rlimit *rlim_stack) in arch_pick_mmap_base() 129 void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) in arch_pick_mmap_layout()
|
/kernel/linux/linux-6.6/arch/x86/mm/ |
H A D | mmap.c | 83 struct rlimit *rlim_stack) in mmap_base() 120 struct rlimit *rlim_stack) in arch_pick_mmap_base() 129 void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) in arch_pick_mmap_layout()
|
/kernel/linux/linux-5.10/tools/testing/selftests/mqueue/ |
H A D | mq_open_tests.c | 53 struct rlimit saved_limits, cur_limits; 65 static inline void getr(int type, struct rlimit *rlim); 66 static inline void setr(int type, struct rlimit *rlim); 141 static inline void getr(int type, struct rlimit *rlim) in getr() 147 static inline void setr(int type, struct rlimit *rlim) in setr() 158 printf("Current rlimit value for POSIX message queue bytes is " in validate_current_settings() 171 "with the current rlimit values.\n\n"); in validate_current_settings() 183 "with the current rlimit values in case this is " in validate_current_settings() 417 "defaults would\nexceed rlimit:" in main() 422 * Test #2 - open with an attr struct that exceeds rlimit in main() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/mqueue/ |
H A D | mq_open_tests.c | 53 struct rlimit saved_limits, cur_limits; 65 static inline void getr(int type, struct rlimit *rlim); 66 static inline void setr(int type, struct rlimit *rlim); 141 static inline void getr(int type, struct rlimit *rlim) in getr() 147 static inline void setr(int type, struct rlimit *rlim) in setr() 158 printf("Current rlimit value for POSIX message queue bytes is " in validate_current_settings() 171 "with the current rlimit values.\n\n"); in validate_current_settings() 183 "with the current rlimit values in case this is " in validate_current_settings() 417 "defaults would\nexceed rlimit:" in main() 422 * Test #2 - open with an attr struct that exceeds rlimit in main() [all...] |
/kernel/linux/linux-5.10/arch/s390/mm/ |
H A D | mmap.c | 29 static inline int mmap_is_legacy(struct rlimit *rlim_stack) in mmap_is_legacy() 49 struct rlimit *rlim_stack) in mmap_base() 172 void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) in arch_pick_mmap_layout()
|
/kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
H A D | mlock-random-test.c | 27 struct rlimit new; in set_cap_limits() 123 * It expects the mlock/mlock2() to be successful (within rlimit) 130 * The memory region size alloc_size is within the rlimit. 143 struct rlimit cur; in test_mlock_within_limit() 148 printf("alloc_size[%d] < %u rlimit,lead to mlock failure\n", in test_mlock_within_limit() 207 * The memory region size alloc_size is above the rlimit. 208 * And the len to be locked is higher than rlimit. 220 struct rlimit cur; in test_mlock_outof_limit() 224 printf("alloc_size[%d] >%u rlimit, violates test condition\n", in test_mlock_outof_limit()
|
/kernel/linux/linux-5.10/security/apparmor/ |
H A D | resource.c | 20 * Table of rlimit names: we generate it from resource.h. 34 audit_log_format(ab, " rlimit=%s value=%lu", in audit_cb() 46 * @resource: rlimit being auditing 73 * rlimit resource can vary based on architecture, map the compiled policy 82 struct rlimit *new_rlim) in profile_setrlimit() 94 * aa_task_setrlimit - test permission to set an rlimit 105 unsigned int resource, struct rlimit *new_rlim) in aa_task_setrlimit() 144 struct rlimit *rlim, *initrlim; in __aa_transition_rlimits()
|
/kernel/linux/linux-6.6/tools/testing/selftests/mm/ |
H A D | mlock-random-test.c | 28 struct rlimit new; in set_cap_limits() 124 * It expects the mlock/mlock2() to be successful (within rlimit) 131 * The memory region size alloc_size is within the rlimit. 144 struct rlimit cur; in test_mlock_within_limit() 149 printf("alloc_size[%d] < %u rlimit,lead to mlock failure\n", in test_mlock_within_limit() 208 * The memory region size alloc_size is above the rlimit. 209 * And the len to be locked is higher than rlimit. 221 struct rlimit cur; in test_mlock_outof_limit() 225 printf("alloc_size[%d] >%u rlimit, violates test condition\n", in test_mlock_outof_limit()
|
/kernel/linux/linux-6.6/security/apparmor/ |
H A D | resource.c | 20 * Table of rlimit names: we generate it from resource.h. 35 audit_log_format(ab, " rlimit=%s value=%lu", in audit_cb() 48 * @resource: rlimit being auditing 80 * rlimit resource can vary based on architecture, map the compiled policy 90 struct rlimit *new_rlim) in profile_setrlimit() 104 * aa_task_setrlimit - test permission to set an rlimit 117 unsigned int resource, struct rlimit *new_rlim) in aa_task_setrlimit() 157 struct rlimit *rlim, *initrlim; in __aa_transition_rlimits()
|
/kernel/linux/linux-6.6/arch/s390/mm/ |
H A D | mmap.c | 29 static inline int mmap_is_legacy(struct rlimit *rlim_stack) in mmap_is_legacy() 49 struct rlimit *rlim_stack) in mmap_base() 172 void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) in arch_pick_mmap_layout()
|