函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:semctl_setval

函数原型:static int semctl_setval(struct ipc_namespace *ns, int semid, int semnum, int val)

返回类型:int

参数:

类型参数名称
struct ipc_namespace *ns
intsemid
intsemnum
intval
1333  如果val大于<= 32767 semaphore maximum value val小于0则返回:负ERANGE
1336  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1337  sma等于sem_obtain_object_check(ns, semid)
1338  如果是错误
1339  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1340  返回:错误
1343  如果semnum小于0或semnum大于等于. of semaphores in array
1344  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1345  返回:负EINVAL
1349  如果pcperms - check ipc permissions*@ns: ipc namespace*@ipcp: ipc permission set*@flag: desired permission set* Check user, group, other permissions for access* to ipc resources. return 0 if allowed*@flag will most probably be 0 or ``S_
1350  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1351  返回:负EACCES
1354  err等于security_sem_semctl( & permissions .. see ipc.h , set semval )
1355  如果err
1356  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1357  返回:负EACCES
1360  If the request contains only one semaphore operation, and there are* no complex transactions pending, lock only the semaphore involved
1362  如果非pc_valid_object() - helper to sort out IPC_RMID races for codepaths* where the respective ipc_ids.rwsem is not being held down.* Checks whether the ipc object is still around or if it's gone already, as
1363  sem_unlock(sma, - 1)
1364  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1365  返回:负EIDRM
1368  semnum等于array_index_nospec - sanitize an array index after a bounds check* For a code sequence like:* if (index < size) {* index = array_index_nospec(index, size);* val = array[index];* }* (semnum, . of semaphores in array )
1369  curr等于sems[semnum]
1371  ipc_assert_locked_object( & permissions .. see ipc.h )
1372  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(un, & undo requests on this array , list_id)
1373  array of adjustments [semnum]等于0
1375  current value 等于val
1376  ipc_update_pid( & PID of the process that last modified the semaphore. For* Linux, specifically these are:* - semop* - semctl, via SETVAL and SETALL.* - at task exit when performing undo adjustments (see exit_sem)., task_tgid(当前进程))
1377  create/last semctl() time 等于ktime_get_real_seconds - Get the seconds portion of CLOCK_REALTIME* Returns the wall clock seconds since 1970. This replaces the* get_seconds() interface which is not y2038 safe on 32bit systems.
1379  do_smart_update - optimized update_queue*@sma: semaphore array*@sops: operations that were performed*@nsops: number of operations*@otime: force setting otime*@wake_q: lockless wake-queue head* do_smart_update() does the required calls to update_queue and
1380  sem_unlock(sma, - 1)
1381  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1382  wake_up_q( & wake_q)
1383  返回:0
调用者
名称描述
ksys_semctl
compat_ksys_semctl