函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sem_alloc

函数原型:static struct sem_array *sem_alloc(size_t nsems)

返回类型:struct sem_array

参数:

类型参数名称
size_tnsems
492  如果nsems大于INT_MAXsma的长度的差除sems[0]的长度则返回: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  如果此条件成立可能性小(为编译器优化)(!sma)则返回:NULL
499  返回:sma
调用者
名称描述
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)