]> granicus.if.org Git - strace/blobdiff - dm.c
mem: decode hugetlb page size in mmap flags
[strace] / dm.c
diff --git a/dm.c b/dm.c
index bf122d9421d4b49981a0b4e3d5a39c63fabcbaf9..28863a871df662b52c438a7dfc415c402306746f 100644 (file)
--- a/dm.c
+++ b/dm.c
 /* Definitions for command which have been added later */
 
 #  ifndef DM_LIST_VERSIONS
-#   define DM_LIST_VERSIONS    _IOWR(DM_IOCTL, 0xd, struct dm_ioctl)
+#   define DM_LIST_VERSIONS    _IOWR(DM_IOCTL, 0x0d, struct dm_ioctl)
 #  endif
 #  ifndef DM_TARGET_MSG
-#   define DM_TARGET_MSG       _IOWR(DM_IOCTL, 0xe, struct dm_ioctl)
+#   define DM_TARGET_MSG       _IOWR(DM_IOCTL, 0x0e, struct dm_ioctl)
 #  endif
 #  ifndef DM_DEV_SET_GEOMETRY
-#   define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0xf, struct dm_ioctl)
+#   define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0x0f, struct dm_ioctl)
+#  endif
+#  ifndef DM_DEV_ARM_POLL
+#   define DM_DEV_ARM_POLL     _IOWR(DM_IOCTL, 0x10, struct dm_ioctl)
 #  endif
 
 
@@ -429,6 +432,7 @@ dm_ioctl_has_params(const unsigned int code)
        case DM_DEV_SUSPEND:
        case DM_DEV_STATUS:
        case DM_TABLE_CLEAR:
+       case DM_DEV_ARM_POLL:
                return false;
        }
 
@@ -479,7 +483,7 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code,
        }
 
        if (exiting(tcp) && syserror(tcp) && !ioc_changed)
-               return 1;
+               return RVAL_IOCTL_DECODED;
 
        /*
         * device mapper code uses %d in some places and %u in another, but
@@ -553,7 +557,7 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code,
 
  skip:
        tprints("}");
-       return 1;
+       return entering(tcp) ? 0 : RVAL_IOCTL_DECODED;
 }
 
 int
@@ -576,9 +580,10 @@ dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t ar
        case DM_LIST_VERSIONS:
        case DM_TARGET_MSG:
        case DM_DEV_SET_GEOMETRY:
+       case DM_DEV_ARM_POLL:
                return dm_known_ioctl(tcp, code, arg);
        default:
-               return 0;
+               return RVAL_DECODED;
        }
 }
 
@@ -587,7 +592,7 @@ dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t ar
 int
 dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg)
 {
-       return 0;
+       return RVAL_DECODED;
 }
 
 # endif /* DM_VERSION_MAJOR == 4 */