Skip to content

Commit b2388fb

Browse files
committed
stty: verify tcsetattr applied all settings
POSIX allows tcsetattr() to return success while only partially applying the requested settings. This change adds verification by reading back the terminal settings after tcsetattr() and comparing them with the requested configuration. If the settings don't match, stty now exits with an error message: "<device>: unable to perform all requested operations" This matches GNU stty behavior, which uses tcgetattr() after setting and compares with eq_mode() to detect partial application. Changes: - Added verify_termios_changes() function to compare termios structs - Uses from_bits_truncate() to normalize flags for portable comparison - Only verifies fields that were actually changed (requested != original) - Added integration test for multiple settings verification Fixes #10324
1 parent c8aa3fc commit b2388fb

3 files changed

Lines changed: 202 additions & 89 deletions

File tree

Lines changed: 86 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
1+
2+
3+
4+
5+
6+
7+
# * CPU/hardware features
8+
# * abbreviations
9+
# * clippy
10+
# * constants
11+
# * variables
112
AFAICT
2-
asimd
13+
AMPM
14+
ASIMD
315
ASIMD
16+
CHLD
17+
EINTR
18+
ENOTSUP
19+
ERANGE
20+
Hijri
21+
Nowruz
22+
PCLMUL
23+
PCLMULQDQ
24+
PMULL
25+
ROOTFS
26+
SETFL
27+
SETFL
28+
SIGCHLD
29+
SIGTTIN
30+
SIGTTOU
31+
SIGUSR
32+
TOCTOU
33+
TUNABLES
34+
TUNABLES
35+
VMULL
436
alloc
37+
ampm
538
arity
39+
asimd
40+
asimd
641
autogenerate
742
autogenerated
843
autogenerates
@@ -14,43 +49,46 @@ canonicalization
1449
canonicalize
1550
canonicalizing
1651
capget
52+
charmap
53+
chld
54+
codegen
1755
codepoint
1856
codepoints
1957
codeready
20-
codegen
2158
colorizable
2259
colorize
23-
coprime
60+
consts
2461
consts
2562
conv
63+
coprime
2664
cyclomatic
2765
dedup
2866
deduplication
67+
delim
2968
demangle
3069
denoland
70+
deps
3171
deque
3272
dequeue
3373
dev
34-
EINTR
35-
eintr
36-
nextest
37-
SIGUSR
38-
nonprinting
39-
multibyte
74+
dev
4075
devs
4176
discoverability
42-
duplicative
4377
dsync
78+
duplicative
79+
eintr
4480
endianness
81+
enotsup
4582
enqueue
46-
ERANGE
83+
errno
4784
errored
85+
esac
86+
eval
4887
executable
4988
executables
5089
exponentiate
51-
eval
52-
esac
5390
falsey
91+
fdlimit
5492
fileio
5593
filesystem
5694
filesystems
@@ -74,41 +112,51 @@ hardlink
74112
hardlinks
75113
hasher
76114
hashsums
115+
hijri
116+
hwcaps
77117
hwcaps
78-
infile
79118
iflag
80119
iflags
120+
inacc
121+
infile
122+
inval
81123
kibi
82124
kibibytes
83125
langinfo
84-
libacl
85126
lcase
127+
libacl
86128
listxattr
87129
llistxattr
88130
lossily
89131
lstat
132+
maint
90133
makedev
91134
mebi
92135
mebibytes
93136
mergeable
94137
microbenchmark
95-
microbenchmarks
96138
microbenchmarking
139+
microbenchmarks
97140
monomorphized
98141
multibyte
142+
multibyte
99143
multicall
144+
nextest
100145
nmerge
101146
noatime
102147
nocache
103148
nocreat
104149
noctty
105150
noerror
106151
noexec
152+
nofield
107153
nofollow
108154
nolinks
109155
nonblock
156+
nonminimal
110157
nonportable
111158
nonprinting
159+
nonprinting
112160
nonrepeating
113161
nonseekable
114162
notrunc
@@ -117,129 +165,82 @@ noxfer
117165
ofile
118166
oflag
119167
oflags
168+
pclmul
169+
pclmulqdq
120170
pdeathsig
121171
peekable
122172
performant
173+
pmull
123174
prctl
124175
precompiled
125176
precompute
126177
preload
127178
prepend
128179
prepended
129180
primality
181+
proc
182+
procs
183+
progname
130184
pseudoprime
131185
pseudoprimes
132186
quantiles
133187
readonly
134-
ROOTFS
135188
reparse
189+
retval
190+
rposition
136191
rposition
137192
seedable
138-
semver
139193
semiprime
140194
semiprimes
195+
semver
141196
setcap
142197
setfacl
143198
setfattr
144-
SETFL
145199
setlocale
200+
setpgid
146201
shortcode
147202
shortcodes
148-
setpgid
149203
sigaction
150-
CHLD
151-
chld
152-
SIGCHLD
153204
sigchld
154205
siginfo
155-
SIGTTIN
156206
sigttin
157-
SIGTTOU
158207
sigttou
159208
sigusr
160209
strcasecmp
161210
subcommand
211+
subdir
162212
subexpression
163213
submodule
164-
sync
165214
symlink
166215
symlinks
216+
sync
167217
syscall
168218
syscalls
169219
sysconf
220+
tcsetattr
221+
tmpfs
170222
tokenize
171223
toolchain
172224
totalram
173225
truthy
174226
tunables
175-
TUNABLES
227+
tunables
176228
ucase
177-
unbuffered
178229
udeps
230+
unbuffered
179231
unescape
232+
uninlined
180233
unintuitive
181-
unprefixed
182234
unportable
235+
unprefixed
183236
unsync
184237
urand
238+
val
239+
vals
240+
vmull
185241
whitespace
186242
wordlist
187243
wordlists
188244
xattrs
189-
xpass
190-
191-
# * abbreviations
192-
AMPM
193-
ampm
194-
consts
195-
deps
196-
dev
197-
fdlimit
198-
inacc
199-
maint
200-
proc
201-
procs
202-
TOCTOU
203-
204-
# * constants
205245
xffff
206-
207-
# * variables
208-
delim
209-
errno
210-
progname
211-
retval
212-
subdir
213-
val
214-
vals
215-
inval
216-
nofield
217-
218-
# * clippy
219-
uninlined
220-
nonminimal
221-
rposition
222-
223-
# * CPU/hardware features
224-
ASIMD
225-
asimd
226-
hwcaps
227-
PCLMUL
228-
pclmul
229-
PCLMULQDQ
230-
pclmulqdq
231-
PMULL
232-
pmull
233-
TUNABLES
234-
tunables
235-
VMULL
236-
vmull
237-
ENOTSUP
238-
enotsup
239-
SETFL
240-
tmpfs
241-
242-
Hijri
243-
Nowruz
244-
charmap
245-
hijri
246+
xpass

0 commit comments

Comments
 (0)