[Toybox] [PATCH] Add stty(1).

enh enh at google.com
Fri Dec 1 23:02:15 PST 2017


Full POSIX stty with Linux extensions. Output and behavior match coreutils
8.26 as far as I can tell. For some reason busybox 1.22 stty always
shows all the special characters, even when they match "sane". I've
matched coreutils, since "shows differences from sane" is easy to describe
and obviously useful.

Flags in the various arrays are not in the order they're introduced in
POSIX or in the Linux header file: they're in the order that they're
output by coreutils' stty.

The -g output matches coreutils and busybox.

I implemented iuclc, xcase, and olcuc even though they've been removed
from POSIX because the others implement them, and "man stty" defines "raw"
and "sane" in terms of them (where POSIX doesn't define "sane" in any
useful sense).

This builds fine against glibc 2.24, and as far as I can tell all the
constants used were in Linux 2.6 so I'm assuming that there shouldn't
be any #ifdef nonsense needed for any reasonable vintage of C library.
---
 toys/pending/stty.c | 528 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 528 insertions(+)
 create mode 100644 toys/pending/stty.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-stty-1.patch
Type: text/x-patch
Size: 16931 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20171201/106a8d9d/attachment-0002.bin>


More information about the Toybox mailing list