函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sys.c Create Date:2022-07-27 10:20:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:make sure you are allowed to change @tsk limits before calling this

函数原型:int do_prlimit(struct task_struct *tsk, unsigned int resource, struct rlimit *new_rlim, struct rlimit *old_rlim)

返回类型:int

参数:

类型参数名称
struct task_struct *tsk
unsigned intresource
struct rlimit *new_rlim
struct rlimit *old_rlim
1533  retval等于0
1535  如果resource大于等于RLIM_NLIMITS则返回:负EINVAL
1537  如果new_rlim
1538  如果rlim_cur大于rlim_max则返回:负EINVAL
1540  如果resource恒等于RLIMIT_NOFILErlim_max大于sysctl_nr_open则返回:负EPERM
1546  read_lock( & tasklist_lock)
1547  如果非sighand
1548  retval等于负ESRCH
1549  转到:out
1552  rlim等于rlimresource
1553  Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring* subscriptions and synchronises with wait4(). Also used in procfs. Also* pins the final release of task.io_context. Also protects ->cpuset and* ->cgroup.subsys[]. And ->vfork_done.
1554  如果new_rlim
1557  如果rlim_max大于rlim_max且非操作权限检查retval等于负EPERM
1560  如果非retvalretval等于security_task_setrlimit(tsk, resource, new_rlim)
1563  如果非retval
1564  如果old_rlimold_rlim等于rlim
1566  如果new_rlimrlim等于new_rlim
1569  task_unlock(线程组主管)
1576  如果非retvalnew_rlimresource恒等于RLIMIT_CPUrlim_cur不等于RLIM_INFINITYIS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_POSIX_TIMERS)则update_rlimit_cpu(tsk, rlim_cur)
1580  out :
1581  read_unlock( & tasklist_lock)
1582  返回:retval
调用者
名称描述
SYSCALL_DEFINE2
COMPAT_SYSCALL_DEFINE2
COMPAT_SYSCALL_DEFINE2
SYSCALL_DEFINE4
SYSCALL_DEFINE2