]> granicus.if.org Git - strace/commitdiff
io: change size types from unsigned long to kernel_ureg_t
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 24 Dec 2016 23:09:16 +0000 (23:09 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 25 Dec 2016 11:32:45 +0000 (11:32 +0000)
* defs.h (tprint_iov_upto): Change the type of len and data_size
arguments from unsigned long to kernel_ureg_t.
(tprint_iov): Change the type of len argument from unsigned long
to kernel_ureg_t.
* io.c (print_iovec_config): Change data_size type from unsigned long
to kernel_ureg_t.
(print_iovec): Change the type of *iov, iov_buf, and len variables
from unsigned long to kernel_ureg_t.
(tprint_iov_upto): Change the type of len and data_size arguments, and
the type of iov variable from unsigned long to kernel_ureg_t.

defs.h
io.c

diff --git a/defs.h b/defs.h
index 6dbc321af37e2f07a7f1b2896e04993814480348..7a11d011ac8d59068891b565a6b4aed9304374f0 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -689,8 +689,8 @@ extern const char *sprintsigmask_n(const char *, const void *, unsigned int);
 extern void printsignal(int);
 
 extern void
-tprint_iov_upto(struct tcb *, unsigned long len, kernel_ureg_t addr,
-               enum iov_decode, unsigned long data_size);
+tprint_iov_upto(struct tcb *, kernel_ureg_t len, kernel_ureg_t addr,
+               enum iov_decode, kernel_ureg_t data_size);
 
 extern void
 decode_netlink(struct tcb *, kernel_ureg_t addr, unsigned long len);
@@ -807,10 +807,10 @@ printxval_long(const struct xlat *x, const unsigned long val, const char *dflt)
 }
 
 static inline void
-tprint_iov(struct tcb *tcp, unsigned long len, kernel_ureg_t addr,
+tprint_iov(struct tcb *tcp, kernel_ureg_t len, kernel_ureg_t addr,
           enum iov_decode decode_iov)
 {
-       tprint_iov_upto(tcp, len, addr, decode_iov, -1UL);
+       tprint_iov_upto(tcp, len, addr, decode_iov, -1);
 }
 
 #ifdef ALPHA
diff --git a/io.c b/io.c
index e3be54adc8659cf7003d267c34ba772a4675956a..28fe74ee94bf06ed5bc546b2fdc48973959015d2 100644 (file)
--- a/io.c
+++ b/io.c
@@ -59,14 +59,14 @@ SYS_FUNC(write)
 
 struct print_iovec_config {
        enum iov_decode decode_iov;
-       unsigned long data_size;
+       kernel_ureg_t data_size;
 };
 
 static bool
 print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
 {
-       const unsigned long *iov;
-       unsigned long iov_buf[2], len;
+       const kernel_ureg_t *iov;
+       kernel_ureg_t iov_buf[2], len;
        struct print_iovec_config *c = data;
 
         if (elem_size < sizeof(iov_buf)) {
@@ -85,14 +85,14 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
                case IOV_DECODE_STR:
                        if (len > c->data_size)
                                len = c->data_size;
-                       if (c->data_size != -1UL)
+                       if (c->data_size != (kernel_ureg_t) -1)
                                c->data_size -= len;
                        printstrn(tcp, iov[0], len);
                        break;
                case IOV_DECODE_NETLINK:
                        if (len > c->data_size)
                                len = c->data_size;
-                       if (c->data_size != -1UL)
+                       if (c->data_size != (kernel_ureg_t) -1)
                                c->data_size -= len;
                        decode_netlink(tcp, iov[0], iov[1]);
                        break;
@@ -111,11 +111,11 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
  * Example: recvmsg returing a short read.
  */
 void
-tprint_iov_upto(struct tcb *const tcp, const unsigned long len,
+tprint_iov_upto(struct tcb *const tcp, const kernel_ureg_t len,
                const kernel_ureg_t addr, const enum iov_decode decode_iov,
-               const unsigned long data_size)
+               const kernel_ureg_t data_size)
 {
-       unsigned long iov[2];
+       kernel_ureg_t iov[2];
        struct print_iovec_config config =
                { .decode_iov = decode_iov, .data_size = data_size };