| 1 |
/* |
| 2 |
* This file contains a few tunables for libptytty. Normally there should |
| 3 |
* be little reason to change this file. It is provided to suit rare or |
| 4 |
* special cases only. |
| 5 |
*/ |
| 6 |
|
| 7 |
/* |
| 8 |
* Default mode to restore when releasing the PTS device. It is relaxed to be |
| 9 |
* compatible with most systems, change it to a more secure value if your |
| 10 |
* system supports it (0640 for example). |
| 11 |
*/ |
| 12 |
#ifndef RESTORE_TTY_MODE |
| 13 |
# define RESTORE_TTY_MODE 0666 |
| 14 |
#endif |
| 15 |
|
| 16 |
/* |
| 17 |
* Define if you want to use a separate process for pty/tty handling |
| 18 |
* when running setuid/setgid. You need this when making it setuid/setgid. |
| 19 |
*/ |
| 20 |
#ifndef PTYTTY_HELPER |
| 21 |
# define PTYTTY_HELPER 1 |
| 22 |
#endif |
| 23 |
|
| 24 |
/* |
| 25 |
* Define if you want to use a single helper process from multiple threads |
| 26 |
* OR forked processes. Without it, the helper will only work from the |
| 27 |
* process having started it, and it might not be possible to start another |
| 28 |
* helper. Having it disabled avoids some syscalls and reduces codesize, |
| 29 |
* but unless you are really short on cpu or memory, it's not worth disabling. |
| 30 |
*/ |
| 31 |
#ifndef PTYTTY_REENTRANT |
| 32 |
# define PTYTTY_REENTRANT 1 |
| 33 |
#endif |
| 34 |
|
| 35 |
/* |
| 36 |
* Provide a STL-like vector class and find algorithm. |
| 37 |
* The default below is fine for normal C++ environments. |
| 38 |
*/ |
| 39 |
#ifndef PTYTTY_NO_LIBCPP |
| 40 |
#include <vector> |
| 41 |
#include <algorithm> |
| 42 |
using namespace std; |
| 43 |
#endif |
| 44 |
|
| 45 |
/* |
| 46 |
* printf-like functions to be called on fatal conditions |
| 47 |
* (must exit), or warning conditions (only print message) |
| 48 |
* TODO move elsewhere, e.g. util.C |
| 49 |
*/ |
| 50 |
#ifndef PTYTTY_FATAL |
| 51 |
#define PTYTTY_FATAL(msg) do { PTYTTY_WARN ("%s", msg); _exit (1); } while (0) |
| 52 |
#endif |
| 53 |
#ifndef PTYTTY_WARN |
| 54 |
#define PTYTTY_WARN(msg,arg) fprintf (stderr, msg, arg) // TODO |
| 55 |
#endif |
| 56 |
|