Przeglądaj źródła

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.
Rich Felker 5 lat temu
rodzic
commit
d01fdc777d
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/misc/ioctl.c

+ 1 - 1
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 {