Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\pipe.c Create Date:2022-07-28 20:04:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:create_pipe_files

Proto:int create_pipe_files(struct file **res, int flags)

Type:int

Parameter:

TypeParameterName
struct file **res
intflags
883  inode = get_pipe_inode()
886  If Not inode Then Return -ENFILE
889  f = alloc_file_pseudo(inode, pipe_mnt, "", O_WRONLY | (flags & (O_NONBLOCK | O_DIRECT)), & pipe.c)
892  If IS_ERR(f) Then
893  free_pipe_info(i_pipe)
894  put an inode
895  Return PTR_ERR(f)
898  needed for tty driver, and maybe others = i_pipe
900  res[0] = alloc_file_clone(f, O_RDONLY | (flags & O_NONBLOCK), & pipe.c)
902  If IS_ERR(res[0]) Then
903  put_pipe_info(inode, i_pipe)
904  fput(f)
905  Return PTR_ERR(res[0])
907  needed for tty driver, and maybe others = i_pipe
908  res[1] = f
909  stream_open is used by subsystems that want stream-like file descriptors.* Such file descriptors are not seekable and don't have notion of position* (file.f_pos is always 0 and ppos passed to .read()/.write() is always NULL).
910  stream_open is used by subsystems that want stream-like file descriptors.* Such file descriptors are not seekable and don't have notion of position* (file.f_pos is always 0 and ppos passed to .read()/.write() is always NULL).
911  Return 0
Caller
NameDescribe
umh_pipe_setup
__do_pipe_flags
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.