summaryrefslogtreecommitdiff
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
parentf9895817321790bef33a56e3b10f3f71d989c23e (diff)
downloadmusl-d01fdc777dd3b5ebcad351ee47d1984d28db31e4.tar.gz
musl-d01fdc777dd3b5ebcad351ee47d1984d28db31e4.tar.bz2
musl-d01fdc777dd3b5ebcad351ee47d1984d28db31e4.tar.xz
musl-d01fdc777dd3b5ebcad351ee47d1984d28db31e4.zip
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.
-rw-r--r--src/misc/ioctl.c2
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 {