KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
fs_pty.h File Reference

Pseudo-terminal virtual file system. More...

#include <sys/cdefs.h>
#include <arch/types.h>
#include <kos/limits.h>
#include <kos/fs.h>

Go to the source code of this file.

Functions

int fs_pty_create (char *buffer, int maxbuflen, file_t *master_out, file_t *slave_out)
 Create a new pseudo-terminal. More...
 

Detailed Description

Pseudo-terminal virtual file system.

This file system implements a pseudo-terminal like concept (similar to /dev/pty in Linux). A call to fs_pty_create() will crate two file entries in the VFS, /pty/maXX and /pty/slXX (XX being some hexadecimal number). From there, anybody can open up either end and send data to the other side. Think of it as a simple message passing interface.

This file system mounts on /pty.

Author
Dan Potter

Function Documentation

int fs_pty_create ( char *  buffer,
int  maxbuflen,
file_t master_out,
file_t slave_out 
)

Create a new pseudo-terminal.

This function creates a new pseudo-terminal, opening up two files in the /pty portion of the VFS.

Parameters
bufferStorage for the name of the PTY, apparently not actually used (but potentially will be fixed at some point). If it was implemented, the name of the PTY would be here on successful return (if not NULL)
maxbuflenThe length of buffer
master_outA pointer to store the file descriptor for the master end in (must not be NULL)
slave_outA pointer to store the file descriptor for the slave end in (must not be NULL)
Return values
0On success
-1On error
Error Conditions:
ENOMEM - out of memory