Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\sem.c Create Date:2022-07-28 16:45:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ksys_semctl

Proto:static long ksys_semctl(int semid, int semnum, int cmd, unsigned long arg, int version)

Type:long

Parameter:

TypeParameterName
intsemid
intsemnum
intcmd
unsigned longarg
intversion
1636  __user * p = arg
1640  If semid < 0 Then Return -EINVAL
1643  ns = ipc_ns
1646  Case cmd == see ipcs
1647  Case cmd == SEM_INFO
1648  Return semctl_info(ns, semid, cmd, p)
1649  Case cmd == get ipc_perm options
1650  Case cmd == pcs ctl cmds
1651  Case cmd == SEM_STAT_ANY
1652  err = semctl_stat(ns, semid, cmd, & semid64)
1653  If err < 0 Then Return err
1655  If copy_semid_to_user(p, & semid64, version) Then err = -EFAULT
1657  Return err
1658  Case cmd == get all semval's
1659  Case cmd == get semval
1660  Case cmd == get sempid
1661  Case cmd == get semncnt
1662  Case cmd == get semzcnt
1663  Case cmd == set all semval's
1664  Return semctl_main(ns, semid, semnum, cmd, p)
1665  Case cmd == set semval
1672  val = arg
1674  Return semctl_setval(ns, semid, semnum, val)
1676  Case cmd == set ipc_perm options
1677  If copy_semid_from_user( & semid64, p, version) Then Return -EFAULT
1680  Case cmd == move resource
1681  Return This function handles some semctl commands which require the rwsem* to be held in write mode.* NOTE: no locks must be held, the rwsem is taken inside this function.
1682  Default
1683  Return -EINVAL
Caller
NameDescribe
SYSCALL_DEFINE4