summaryrefslogtreecommitdiff
path: root/corebinutils/stty/README.md
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:29:35 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:29:35 +0300
commit1edb2cb7b8a720ba8ae4438947256515a93b7ca9 (patch)
tree7428ee326d8d1f00331258b038a33d675f7e0459 /corebinutils/stty/README.md
parent3c4ab8392fcf79e40b8bc02a39b9c6d03492fcb7 (diff)
parentf59550da80c3bd763f1d9782b3b3a06f16826889 (diff)
downloadProject-Tick-1edb2cb7b8a720ba8ae4438947256515a93b7ca9.tar.gz
Project-Tick-1edb2cb7b8a720ba8ae4438947256515a93b7ca9.zip
Add 'corebinutils/stty/' from commit 'f59550da80c3bd763f1d9782b3b3a06f16826889'
git-subtree-dir: corebinutils/stty git-subtree-mainline: 3c4ab8392fcf79e40b8bc02a39b9c6d03492fcb7 git-subtree-split: f59550da80c3bd763f1d9782b3b3a06f16826889
Diffstat (limited to 'corebinutils/stty/README.md')
-rw-r--r--corebinutils/stty/README.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/corebinutils/stty/README.md b/corebinutils/stty/README.md
new file mode 100644
index 0000000000..b371a36dcf
--- /dev/null
+++ b/corebinutils/stty/README.md
@@ -0,0 +1,46 @@
+# stty
+
+Linux-native `stty` port of the FreeBSD userland tool, built for Linux + musl without a BSD shim layer.
+
+## Build
+
+```sh
+make -C bin/stty
+make -C bin/stty clean all CC=musl-gcc
+```
+
+## Test
+
+```sh
+make -C bin/stty test
+make -C bin/stty clean test CC=musl-gcc
+```
+
+The test suite creates its own pseudoterminal, verifies termios and winsize state through independent helpers, and exercises negative paths as well as round-trip `-g` restore behavior.
+
+## Port strategy
+
+- Replaced the FreeBSD multi-file implementation with a single Linux-native termios/winsize implementation.
+- Kept `stty.1` as the semantic contract and mapped documented behavior directly onto Linux APIs:
+ - `tcgetattr(3)` / `tcsetattr(3)` for termios state
+ - `cfsetispeed(3)` / `cfsetospeed(3)` for baud rates
+ - `TIOCGWINSZ` / `TIOCSWINSZ` for `size`, `rows`, and `columns`
+ - `TIOCGETD` / `TIOCSETD` with `N_TTY` for `tty`
+ - `EXTPROC` local flag for `extproc`
+- Avoided GNU-specific behavior; the build only enables `_DEFAULT_SOURCE` and `_XOPEN_SOURCE=700`.
+
+## Linux-supported and unsupported semantics
+
+Supported:
+
+- POSIX and BSD output modes: default, `-a`, `-e`, `-g`
+- Linux termios flags and compatibility aliases documented in `stty.1`
+- `speed`, `ispeed`, `ospeed`, bare numeric baud-rate arguments, `raw`, `-raw`, `sane`, `cbreak`, `dec`, `tty`, `rows`, `columns`, `size`
+
+Explicitly unsupported with hard errors:
+
+- `altwerase`, `mdmbuf`, `rtsdtr`
+- `kerninfo` / `nokerninfo`
+- control characters `status`, `dsusp`, `erase2`
+- `ek`, because Linux has no `VERASE2` and partial emulation would silently change semantics
+- arbitrary non-table baud rates such as `12345`; this port intentionally stays on the stable Linux termios API instead of silently inventing `termios2` behavior