summary refs log tree commit diff
path: root/progs/tty/tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/tty/tty.c')
-rw-r--r--progs/tty/tty.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/progs/tty/tty.c b/progs/tty/tty.c
new file mode 100644
index 0000000..d906121
--- /dev/null
+++ b/progs/tty/tty.c
@@ -0,0 +1,10 @@
+#include <unistd.h>
+#include <stdlib.h>
+
+__attribute__((force_align_arg_pointer))
+int main() {
+    char *tty = ttyname(1);
+    write(1, tty, sizeof(tty));
+    write(1, "\n", 1);
+    exit(0);
+}
\ No newline at end of file