The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
fifo.h File Reference

named pipes (FIFOs): a pipe that processes reach by a name. More...

#include "common/stdint.h"
#include "kernel/fs/fs.h"
#include "kernel/vfs/file.h"

Go to the source code of this file.

Functions

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.
void fifo_close (file_t *file)
 close an end of a named pipe (the file's release).

Detailed Description

named pipes (FIFOs): a pipe that processes reach by a name.

all who open the same named pipe share one pipe. it lives while one of them has it open; then the next open starts an empty one. opening one end waits until the other end is open too, unless O_NONBLOCK is given (then a read end opens at once, and a write end with no reader fails with ENXIO). O_RDWR opens both ends and does not wait.

Function Documentation

◆ 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.

Parameters
flagsthe open flags (the access mode and O_NONBLOCK).
outgets the open file.
Returns
0, or -ENXIO, -ERESTARTSYS (a signal while waiting), -ENOMEM, -ENFILE (too many named pipes open at once).

◆ fifo_close()

void fifo_close ( file_t * file)

close an end of a named pipe (the file's release).