Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sem_alloc

Proto:static struct sem_array *sem_alloc(size_t nsems)

Type:struct sem_array

Parameter:

TypeParameterName
size_tnsems
492  If nsems > (INT_MAX - size of sma ) / size of sems[0] Then Return NULL
495  sma = kvzalloc(struct_size() - Calculate size of structure with trailing array.*@p: Pointer to the structure.*@member: Name of the array member.*@n: Number of elements in the array.* Calculates size of memory needed for structure @p followed by an(sma, sems, nsems), GFP_KERNEL)
496  If Value for the false possibility is greater at compile time(!sma) Then Return NULL
499  Return sma
Caller
NameDescribe
newarywary - Create a new semaphore set*@ns: namespace*@params: ptr to the structure that contains key, semflg and nsems* Called with sem_ids.rwsem held (as a writer)