musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/misc/ioctl.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019年12月22日 13:25:17 -0500
committerRich Felker <dalias@aerifal.cx>2019年12月22日 13:25:58 -0500
commitd01fdc777dd3b5ebcad351ee47d1984d28db31e4 (patch)
tree411716159015c345b6c2f0af0f60864f039c6d3f /src/misc/ioctl.c
parentf9895817321790bef33a56e3b10f3f71d989c23e (diff)
downloadmusl-d01fdc777dd3b5ebcad351ee47d1984d28db31e4.tar.gz
spare archs without time32 legacy the cost of ioctl fallback conversions
adding this condition makes the entire convert_ioctl_struct function and compat_map table statically unreachable, and thereby optimized out by dead code elimination, on archs where they are not needed.
Diffstat (limited to 'src/misc/ioctl.c')
-rw-r--r--src/misc/ioctl.c 2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc/ioctl.c b/src/misc/ioctl.c
index aa748fb8..89477511 100644
--- a/src/misc/ioctl.c
+++ b/src/misc/ioctl.c
@@ -120,7 +120,7 @@ int ioctl(int fd, int req, ...)
arg = va_arg(ap, void *);
va_end(ap);
int r = __syscall(SYS_ioctl, fd, req, arg);
- if (req && r==-ENOTTY) {
+ if (SIOCGSTAMP != SIOCGSTAMP_OLD && req && r==-ENOTTY) {
for (int i=0; i<sizeof compat_map/sizeof *compat_map; i++) {
if (compat_map[i].new_req != req) continue;
union {
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月23日 20:52:46 +0000

AltStyle によって変換されたページ (->オリジナル) /