|
PatchworkOS
28a9544
A non-POSIX operating system.
|
Pipes. More...
Data Structures | |
| struct | pipe_private_t |
Functions | |
| static uint64_t | pipe_open (file_t *file) |
| static uint64_t | pipe_open2 (file_t *files[2]) |
| static void | pipe_close (file_t *file) |
| static uint64_t | pipe_read (file_t *file, void *buffer, uint64_t count, uint64_t *offset) |
| static uint64_t | pipe_write (file_t *file, const void *buffer, uint64_t count, uint64_t *offset) |
| static wait_queue_t * | pipe_poll (file_t *file, poll_events_t *revents) |
| uint64_t | pipe_init (void) |
| void | pipe_deinit (void) |
Variables | |
| static dentry_t * | pipeDir = NULL |
| static dentry_t * | newFile = NULL |
| static file_ops_t | fileOps |
Pipes.
Pipes are exposed in the /dev/pipe directory. Pipes are unidirectional communication channels that can be used for inter-process communication (IPC).
Pipes are created using the /dev/pipe/new file. Opening this file using open() will return one file descriptor that can be used for both reading and writing. To create a pipe with separate file descriptors for reading and writing, use open2() with the /dev/pipe/new file.
Pipes can be read from and written to using the expected read() and write() system calls. Pipes are blocking and pollable, following expected POSIX semantics.
|
static |
Definition at line 106 of file pipe.c.
References EOK, file, free(), lock_acquire(), lock_release(), pmm_free(), dentry_t::private, WAIT_ALL, wait_queue_deinit(), and wait_unblock().
| void pipe_deinit | ( | void | ) |
| uint64_t pipe_init | ( | void | ) |
Definition at line 239 of file pipe.c.
References DEREF, ERR, fileOps, LOG_ERR, newFile, NULL, pipeDir, sysfs_dir_new(), and sysfs_file_new().
Referenced by _module_procedure().
Definition at line 53 of file pipe.c.
References ERR, file, free(), lock_init(), malloc(), NULL, PAGE_SIZE, pmm_alloc(), dentry_t::private, ring_init(), and wait_queue_init().
Definition at line 79 of file pipe.c.
References ERR, files, free(), lock_init(), malloc(), NULL, PAGE_SIZE, PIPE_READ, PIPE_WRITE, pmm_alloc(), ring_init(), and wait_queue_init().
|
static |
Definition at line 213 of file pipe.c.
References file, LOCK_SCOPE, POLLIN, POLLOUT, dentry_t::private, ring_data_length(), and ring_free_length().
|
static |
Definition at line 132 of file pipe.c.
References buffer, count, EINVAL, ENOTSUP, EOK, ERR, errno, file, LOCK_SCOPE, MIN, NULL, PAGE_SIZE, panic(), dentry_t::private, ring_data_length(), ring_read(), WAIT_ALL, WAIT_BLOCK_LOCK, and wait_unblock().
|
static |
Definition at line 172 of file pipe.c.
References buffer, count, EINVAL, ENOTSUP, EOK, EPIPE, ERR, errno, file, LOCK_SCOPE, NULL, PAGE_SIZE, panic(), dentry_t::private, ring_free_length(), ring_write(), WAIT_ALL, WAIT_BLOCK_LOCK, and wait_unblock().
|
static |
Definition at line 230 of file pipe.c.
Referenced by pipe_init().
Definition at line 51 of file pipe.c.
Referenced by pipe_deinit(), and pipe_init().
Definition at line 50 of file pipe.c.
Referenced by pipe_deinit(), and pipe_init().