提交 d01fdc77 编写于 作者: R Rich Felker

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.
上级 f9895817
...@@ -120,7 +120,7 @@ int ioctl(int fd, int req, ...) ...@@ -120,7 +120,7 @@ int ioctl(int fd, int req, ...)
arg = va_arg(ap, void *); arg = va_arg(ap, void *);
va_end(ap); va_end(ap);
int r = __syscall(SYS_ioctl, fd, req, arg); 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++) { for (int i=0; i<sizeof compat_map/sizeof *compat_map; i++) {
if (compat_map[i].new_req != req) continue; if (compat_map[i].new_req != req) continue;
union { union {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册