KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
fs_pty.h
Go to the documentation of this file.
1 /* KallistiOS 2.0.0
2 
3  kos/fs_pty.h
4  Copyright (C)2003 Dan Potter
5 
6 */
7 
8 /** \file kos/fs_pty.h
9  \brief Pseudo-terminal virtual file system.
10 
11  This file system implements a pseudo-terminal like concept (similar to
12  /dev/pty in Linux). A call to fs_pty_create() will crate two file entries in
13  the VFS, /pty/maXX and /pty/slXX (XX being some hexadecimal number). From
14  there, anybody can open up either end and send data to the other side. Think
15  of it as a simple message passing interface.
16 
17  This file system mounts on /pty.
18 
19  \author Dan Potter
20 */
21 
22 #ifndef __KOS_FS_PTY_H
23 #define __KOS_FS_PTY_H
24 
25 #include <sys/cdefs.h>
26 __BEGIN_DECLS
27 
28 #include <arch/types.h>
29 #include <kos/limits.h>
30 #include <kos/fs.h>
31 
32 /** \brief Create a new pseudo-terminal.
33 
34  This function creates a new pseudo-terminal, opening up two files in the
35  /pty portion of the VFS.
36 
37  \param buffer Storage for the name of the PTY, apparently not
38  actually used (but potentially will be fixed at some
39  point). If it was implemented, the name of the PTY
40  would be here on successful return (if not NULL)
41  \param maxbuflen The length of buffer
42  \param master_out A pointer to store the file descriptor for the
43  master end in (must not be NULL)
44  \param slave_out A pointer to store the file descriptor for the slave
45  end in (must not be NULL)
46  \retval 0 On success
47  \retval -1 On error
48 
49  \par Error Conditions:
50  \em ENOMEM - out of memory
51 */
52 int fs_pty_create(char * buffer, int maxbuflen, file_t * master_out, file_t * slave_out);
53 
54 /** \cond */
55 int fs_pty_init();
56 int fs_pty_shutdown();
57 /** \endcond */
58 
59 __END_DECLS
60 
61 #endif /* __KOS_FS_PTY_H */
62