The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
fifo.h
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* @file fifo.h
5
* @brief named pipes (FIFOs): a pipe that processes reach by a name.
6
*
7
* all who open the same named pipe share one pipe. it lives while one of
8
* them has it open; then the next open starts an empty one. opening one
9
* end waits until the other end is open too, unless O_NONBLOCK is given
10
* (then a read end opens at once, and a write end with no reader fails
11
* with ENXIO). O_RDWR opens both ends and does not wait.
12
*/
13
14
#include "
common/stdint.h
"
15
#include "
kernel/fs/fs.h
"
16
#include "
kernel/vfs/file.h
"
17
18
/**
19
* open the named pipe that is inode on a mount.
20
* @param flags the open flags (the access mode and O_NONBLOCK).
21
* @param out gets the open file.
22
* @return 0, or -ENXIO, -ERESTARTSYS (a signal while waiting), -ENOMEM,
23
* -ENFILE (too many named pipes open at once).
24
*/
25
int32_t
fifo_open
(
fs_mount_t
*mount,
uint32_t
inode,
uint32_t
flags
,
file_t
**out);
26
27
/**
28
* close an end of a named pipe (the file's release).
29
*/
30
void
fifo_close
(
file_t
*
file
);
stdint.h
fs_mount_t
struct fs_mount fs_mount_t
filesystem operations vtable.
Definition
ext2_ops.h:7
fifo_close
void fifo_close(file_t *file)
close an end of a named pipe (the file's release).
Definition
fifo.c:186
fifo_open
int32_t fifo_open(fs_mount_t *mount, uint32_t inode, uint32_t flags, file_t **out)
open the named pipe that is inode on a mount.
Definition
fifo.c:77
fs.h
flags
uint8_t flags
Definition
idt.c:3
file.h
file_t
struct file file_t
Definition
file.h:38
uint32_t
unsigned int uint32_t
Definition
fb.h:17
int32_t
int int32_t
Definition
stdint.h:14
file
an open-file description.
Definition
file.h:64
src
kernel
vfs
fifo.h
Generated by
1.18.0