Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\fork.c Create Date:2022-07-28 08:58:58
Last Modify:2020-03-17 11:04:53 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Unshare file descriptor table if it is being shared

Proto:static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp)

Type:int

Parameter:

TypeParameterName
unsigned longunshare_flags
struct files_struct **new_fdp
2874  fd = files
2875  error = 0
2877  If unshare_flags & set if open files shared between processes && fd && atomic_read( & ad mostly part) > 1 Then
2879  new_fdp = dup_fd(fd, & error)
2880  If Not new_fdp Then Return error
2884  Return 0
Caller
NameDescribe
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.