Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sys.c Create Date:2022-07-28 09:20:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:make sure you are allowed to change @tsk limits before calling this

Proto:int do_prlimit(struct task_struct *tsk, unsigned int resource, struct rlimit *new_rlim, struct rlimit *old_rlim)

Type:int

Parameter:

TypeParameterName
struct task_struct *tsk
unsigned intresource
struct rlimit *new_rlim
struct rlimit *old_rlim
1533  retval = 0
1535  If resource >= RLIM_NLIMITS Then Return -EINVAL
1537  If new_rlim Then
1538  If rlim_cur > rlim_max Then Return -EINVAL
1540  If resource == RLIMIT_NOFILE && rlim_max > sysctl_nr_open Then Return -EPERM
1546  read_lock( & tasklist_lock)
1547  If Not sighand Then
1548  retval = -ESRCH
1549  Go to out
1552  rlim = rlim + resource
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  If new_rlim Then
1557  If rlim_max > rlim_max && Not Check operation authority Then retval = -EPERM
1560  If Not retval Then retval = security_task_setrlimit(tsk, resource, new_rlim)
1563  If Not retval Then
1564  If old_rlim Then old_rlim = rlim
1566  If new_rlim Then rlim = new_rlim
1569  task_unlock(group_leader)
1576  If Not retval && new_rlim && resource == RLIMIT_CPU && rlim_cur != RLIM_INFINITY && IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_POSIX_TIMERS) Then update_rlimit_cpu(tsk, rlim_cur)
1580  out :
1581  read_unlock( & tasklist_lock)
1582  Return retval
Caller
NameDescribe
SYSCALL_DEFINE2
COMPAT_SYSCALL_DEFINE2
COMPAT_SYSCALL_DEFINE2
SYSCALL_DEFINE4
SYSCALL_DEFINE2