1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/*
* Pseudo-tty backend for pterm.
*
* Unlike the other backends, data for this one is not neatly
* encapsulated into a data structure, because it wouldn't make
* sense to do so - the utmp stuff has to be done before a backend
* is initialised, and starting a second pterm from the same
* process would therefore be infeasible because privileges would
* already have been dropped. Hence, I haven't bothered to keep the
* data dynamically allocated: instead, the backend handle is just
* a null pointer and ignored everywhere.
*/
#define _XOPEN_SOURCE
#define _XOPEN_SOURCE_EXTENDED
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
/*
* Pseudo-tty backend for pterm.
*
* Unlike the other backends, data for this one is not neatly
* encapsulated into a data structure, because it wouldn't make
* sense to do so - the utmp stuff has to be done before a backend
* is initialised, and starting a second pterm from the same
* process would therefore be infeasible because privileges would
* already have been dropped. Hence, I haven't bothered to keep the
* data dynamically allocated: instead, the backend handle is just
* a null pointer and ignored everywhere.
*/
#define _XOPEN_SOURCE 600
#define _XOPEN_SOURCE_EXTENDED
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
|