函数逻辑报告

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

函数名称:replace_fd

函数原型:int replace_fd(unsigned fd, struct file *file, unsigned flags)

返回类型:int

参数:

类型参数名称
unsignedfd
struct file *file
unsignedflags
890  files等于files
892  如果非file则返回:The same warnings as for __alloc_fd()/__fd_install() apply here...
895  如果fd大于等于rlimit(RLIMIT_NOFILE)则返回:负EBADF
898  加自旋锁
899  err等于Expand files.* This function will expand the file structures, if the requested size exceeds* the current capacity and there is room for expansion.* Return <0 error code on error; 0 when nothing done; 1 when files were
900  如果此条件成立可能性小(为编译器优化)(err < 0)则转到:out_unlock
902  返回:do_dup2(files, file, fd, flags)
904  out_unlock :
905  自旋锁解锁
906  返回:err
调用者
名称描述
umh_pipe_setup
aa_inherit_filesased on selinux's flush_unauthorized_files
umh_pipe_setupmh_pipe_setup* helper function to customize the process used* to collect the core in userspace. Specifically* it sets up a pipe and installs it as fd 0 (stdin)* for the process. Returns 0 on success, or* PTR_ERR on failure.