From: Dmitry V. Levin Date: Sat, 24 Dec 2016 23:09:16 +0000 (+0000) Subject: io: change size types from unsigned long to kernel_ureg_t X-Git-Tag: v4.16~188 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ccde53d7f07e8818030ff38f3b18491f2d2e52c;p=strace io: change size types from unsigned long to kernel_ureg_t * 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. --- diff --git a/defs.h b/defs.h index 6dbc321a..7a11d011 100644 --- 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 e3be54ad..28fe74ee 100644 --- 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 };