summary refs log tree commit diff
path: root/progs/tty/tty.c
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-02-15 10:51:57 +0200
committerWlodekM <[email protected]>2025-02-15 10:51:57 +0200
commit545c5f85c38de8ddb8c026bf3b76658c8d8f3d6b (patch)
treea9df68df52ff273715b595efc7cd4cb20f7859a3 /progs/tty/tty.c
parent967d5cd81a190f6aa7ac44c269d60ae3a1071464 (diff)
fix some stuff; add some coreutils
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