From 1379851360349d6617ad32944a25ee5e2bb74fc2 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 8 Aug 2015 19:12:30 -0400 Subject: Baseline firejail 0.9.28 --- src/tools/ttytest.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/tools/ttytest.c (limited to 'src/tools/ttytest.c') diff --git a/src/tools/ttytest.c b/src/tools/ttytest.c new file mode 100644 index 000000000..a449bf9ba --- /dev/null +++ b/src/tools/ttytest.c @@ -0,0 +1,36 @@ +#define _XOPEN_SOURCE 600 +#include +#include +#include +#include + +int main(void) { + int fdm; + int rc; + + // initial + system("ls -l /dev/pts"); + + fdm = posix_openpt(O_RDWR); + if (fdm < 0) { + perror("posix_openpt"); + return 1; + } + + rc = grantpt(fdm); + if (rc != 0) { + perror("grantpt"); + return 1; + } + + rc = unlockpt(fdm); + if (rc != 0) { + perror("unlockpt"); + return 1; + } + + // final + system("ls -l /dev/pts"); + + return 0; +} -- cgit v1.2.3-70-g09d2