diff --git a/src/misc/ioctl.c b/src/misc/ioctl.c index 49282811..6d3e5095 100644 --- a/src/misc/ioctl.c +++ b/src/misc/ioctl.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "syscall.h" #define alignof(t) offsetof(struct { char c; t x; }, x) @@ -90,7 +91,14 @@ static void convert_ioctl_struct(const struct ioctl_compat_map *map, char *old, * if another exception appears this needs changing. */ convert_ioctl_struct(map+1, old, new, dir); convert_ioctl_struct(map+2, old+4, new+8, dir); - convert_ioctl_struct(map+3, old+68, new+72, dir); + int adj = BYTE_ORDER==BIG_ENDIAN ? 4 : 0; + if (dir==W) { + memcpy(old+68, new+72+adj, 4); + memcpy(old+72, new+72+4+2*adj, 4); + } else { + memcpy(new+72+adj, old+68, 4); + memcpy(new+72+4+2*adj, old+72, 4); + } return; } for (int i=0; i < map->noffs; i++) {