KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
fs_pty.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 kos/fs_pty.h
4 Copyright (C)2003 Megan Potter
5
6*/
7
8/** \file kos/fs_pty.h
9 \brief Pseudo-terminal virtual file system.
10 \ingroup vfs_pty
11
12 This file system implements a pseudo-terminal like concept (similar to
13 /dev/pty in Linux). A call to fs_pty_create() will create two file entries in
14 the VFS, /pty/maXX and /pty/slXX (XX being some hexadecimal number). From
15 there, anybody can open up either end and send data to the other side. Think
16 of it as a simple message passing interface.
17
18 This file system mounts on /pty.
19
20 \author Megan Potter
21*/
22
23#ifndef __KOS_FS_PTY_H
24#define __KOS_FS_PTY_H
25
26#include <sys/cdefs.h>
27__BEGIN_DECLS
28
29#include <kos/fs.h>
30
31/** \defgroup vfs_pty PTY
32 \brief VFS driver for accessing pseudo-TTY terminals
33 \ingroup vfs
34
35 @{
36*/
37
38/** \brief Create a new pseudo-terminal.
39
40 This function creates a new pseudo-terminal, opening up two files in the
41 /pty portion of the VFS.
42
43 \param buffer Storage for the name of the PTY, apparently not
44 actually used (but potentially will be fixed at some
45 point). If it was implemented, the name of the PTY
46 would be here on successful return (if not NULL)
47 \param maxbuflen The length of buffer
48 \param master_out A pointer to store the file descriptor for the
49 master end in (must not be NULL)
50 \param slave_out A pointer to store the file descriptor for the slave
51 end in (must not be NULL)
52 \retval 0 On success
53 \retval -1 On error
54
55 \par Error Conditions:
56 \em ENOMEM - out of memory
57*/
58int fs_pty_create(char * buffer, int maxbuflen, file_t * master_out, file_t * slave_out);
59
60/** \cond */
61void fs_pty_init(void);
62void fs_pty_shutdown(void);
63/** \endcond */
64
65/** @} */
66
67__END_DECLS
68
69#endif /* __KOS_FS_PTY_H */
70
Virtual filesystem support.
int file_t
File descriptor type.
Definition fs.h:94
int fs_pty_create(char *buffer, int maxbuflen, file_t *master_out, file_t *slave_out)
Create a new pseudo-terminal.