函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\fork.c Create Date:2022-07-27 09:58:28
Last Modify:2020-03-17 11:04:53 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Unshare file descriptor table if it is being shared

函数原型:static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp)

返回类型:int

参数:

类型参数名称
unsigned longunshare_flags
struct files_struct **new_fdp
2874  fd等于files
2875  error等于0
2877  如果unshare_flags按位与共享文件描述符fdatomic_read( & ad mostly part)大于1则
2879  new_fdp等于dup_fd(fd, & error)
2880  如果非new_fdp则返回:error
2884  返回:0
调用者
名称描述
ksys_unshareshare allows a process to 'unshare' part of the process* context which was originally shared using clone. copy_** functions used by do_fork() cannot be used here directly* because they modify an inactive task_struct that is being* constructed
unshare_filesHelper to unshare the files of the current task.* We don't want to expose copy_files internals to* the exec layer of the kernel.