diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2016-07-18 16:25:25 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2016-07-19 17:46:33 +0000 |
commit | 3a161d19021710dd8c746655c45eb97aeba93051 (patch) | |
tree | 796093daa2f78de6bdb156e3dac0168bff719a54 /tests/mmsg_name.c | |
parent | 850523683d1d4fb36325fedb0b0f291eda720d98 (diff) | |
download | strace-3a161d19021710dd8c746655c45eb97aeba93051.tar.gz |
Print unsent messages of sendmmsg syscall
* defs.h (decode_mmsgvec): Add int argument.
* mmsghdr.c (print_struct_mmsghdr_config): Add msg_len_vlen field.
(print_struct_mmsghdr): Print struct mmsghdr.msg_len only for
msg_len_vlen first elements of struct mmsghdr array.
(decode_mmsgvec): Add msg_len_vlen argument.
(SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Pass to decode_mmsgvec
the number of elements of struct mmsghdr array that contain meaningful
struct mmsghdr.msg_len.
* tests/mmsg_name.c (test_mmsg_name): Check it.
Diffstat (limited to 'tests/mmsg_name.c')
-rw-r--r-- | tests/mmsg_name.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/mmsg_name.c b/tests/mmsg_name.c index e90cafdb0..466b602db 100644 --- a/tests/mmsg_name.c +++ b/tests/mmsg_name.c @@ -104,19 +104,22 @@ test_mmsg_name(const int send_fd, const int recv_fd) perror_msg_and_skip("sendmmsg"); printf("sendmmsg(%d, [", send_fd); - for (i = 0; i < rc; ++i) { + for (i = 0; i < IOV_MAX1; ++i) { if (i) printf(", "); + if (i >= IOV_MAX #ifndef VERBOSE_MMSGHDR - if (i >= DEFAULT_STRLEN) { + || i >= DEFAULT_STRLEN +#endif + ) { printf("..."); break; } -#endif printf("{msg_hdr={msg_name=NULL, msg_namelen=0" ", msg_iov=[{iov_base=\"%c\", iov_len=1}]" - ", msg_iovlen=1, msg_controllen=0, msg_flags=0}" - ", msg_len=1}", '0' + i % 10); + ", msg_iovlen=1, msg_controllen=0, msg_flags=0}%s}", + '0' + i % 10, + i < rc ? ", msg_len=1" : ""); } printf("], %u, MSG_DONTWAIT) = %d\n", IOV_MAX1, rc); |