• Home
  • Raw
  • Download

Lines Matching +full:max +full:- +full:cur

1 // SPDX-License-Identifier: GPL-2.0
24 #define PAGE_ALIGN(size, ps) (((size) + ((ps) - 1)) & ~((ps) - 1))
26 int set_cap_limits(rlim_t max) in set_cap_limits() argument
31 new.rlim_cur = max; in set_cap_limits()
32 new.rlim_max = max; in set_cap_limits()
35 return -1; in set_cap_limits()
41 return -2; in set_cap_limits()
50 int ret = -1; in get_proc_locked_vm_size()
57 return -1; in get_proc_locked_vm_size()
67 return -1; in get_proc_locked_vm_size()
76 return -1; in get_proc_locked_vm_size()
136 * return value: 0 - success
144 struct rlimit cur; in test_mlock_within_limit() local
147 getrlimit(RLIMIT_MEMLOCK, &cur); in test_mlock_within_limit()
148 if (cur.rlim_cur < alloc_size) { in test_mlock_within_limit()
150 alloc_size, (unsigned int)cur.rlim_cur); in test_mlock_within_limit()
151 return -1; in test_mlock_within_limit()
157 * - choose mlock/mlock2 randomly in test_mlock_within_limit()
158 * - choose lock_size randomly but lock_size < alloc_size in test_mlock_within_limit()
159 * - choose start_offset randomly but p+start_offset+lock_size in test_mlock_within_limit()
164 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_within_limit()
188 return -1; in test_mlock_within_limit()
194 return -1; in test_mlock_within_limit()
213 * return value: 0 - success
221 struct rlimit cur; in test_mlock_outof_limit() local
223 getrlimit(RLIMIT_MEMLOCK, &cur); in test_mlock_outof_limit()
224 if (cur.rlim_cur >= alloc_size) { in test_mlock_outof_limit()
226 alloc_size, (unsigned int)cur.rlim_cur); in test_mlock_outof_limit()
227 return -1; in test_mlock_outof_limit()
234 int lock_size = (rand() % (alloc_size - cur.rlim_cur)) in test_mlock_outof_limit()
235 + cur.rlim_cur; in test_mlock_outof_limit()
236 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_outof_limit()
248 return -1; in test_mlock_outof_limit()
257 return -1; in test_mlock_outof_limit()
269 return -1; in main()
274 return -1; in main()
286 return -1; in main()