函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file.c Create Date:2022-07-29 10:38:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:do_dup2

函数原型:static int do_dup2(struct files_struct *files, struct file *file, unsigned fd, unsigned flags)__releases(&files->file_lock)

返回类型:int

参数:

类型参数名称
struct files_struct *files
struct file *file
unsignedfd
unsignedflags
864  fdt等于files_fdtable(files)
865  tofree等于 current fd array [fd]
866  如果非tofreefd_is_open(fd, fdt)则转到:Ebusy
868  get_file(file)
869  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( current fd array [fd], file)
870  __set_open_fd(fd, fdt)
871  如果flags按位与O_CLOEXEC__set_close_on_exec(fd, fdt)
873  否则__clear_close_on_exec(fd, fdt)
875  自旋锁解锁
877  如果tofree"id" is the POSIX thread ID. We use the* files pointer for this..
880  返回:fd
882  Ebusy :
883  自旋锁解锁
884  返回:负EBUSY
调用者
名称描述
replace_fd
ksys_dup3