]> granicus.if.org Git - strace/blobdiff - msghdr.c
signal: fix omission of field names in sigaction printers
[strace] / msghdr.c
index c70a93ae90ef4fac2c92563d2c8ec1b7880042ec..63f5171457e50d744f66b470ab65af029e357139 100644 (file)
--- a/msghdr.c
+++ b/msghdr.c
@@ -31,6 +31,7 @@
 
 #include "defs.h"
 #include "msghdr.h"
+#include <limits.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
 
@@ -229,10 +230,6 @@ print_cmsg_type_data(struct tcb *tcp, const int cmsg_level, const int cmsg_type,
        }
 }
 
-#ifndef UIO_MAXIOV
-# define UIO_MAXIOV 1024
-#endif
-
 static unsigned int
 get_optmem_max(void)
 {
@@ -241,7 +238,7 @@ get_optmem_max(void)
        if (!optmem_max) {
                if (read_int_from_file("/proc/sys/net/core/optmem_max",
                                       &optmem_max) || optmem_max <= 0) {
-                       optmem_max = sizeof(long long) * (2 * UIO_MAXIOV + 512);
+                       optmem_max = sizeof(long long) * (2 * IOV_MAX + 512);
                } else {
                        optmem_max = (optmem_max + sizeof(long long) - 1)
                                     & ~(sizeof(long long) - 1);
@@ -421,14 +418,12 @@ SYS_FUNC(recvmsg)
                printfd(tcp, tcp->u_arg[0]);
                tprints(", ");
                if (fetch_msghdr_namelen(tcp, tcp->u_arg[1], &msg_namelen)) {
-                       /* abuse of auxstr to retain state */
-                       tcp->auxstr = (void *) (long) msg_namelen;
+                       set_tcb_priv_ulong(tcp, msg_namelen);
                        return 0;
                }
                printaddr(tcp->u_arg[1]);
        } else {
-               msg_namelen = (long) tcp->auxstr;
-               tcp->auxstr = NULL;
+               msg_namelen = get_tcb_priv_ulong(tcp);
 
                if (syserror(tcp))
                        tprintf("{msg_namelen=%d}", msg_namelen);