]> granicus.if.org Git - strace/blob - print_group_req.c
tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
[strace] / print_group_req.c
1 /*
2  * Copyright (c) 2015-2018 The strace developers.
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: LGPL-2.1-or-later
6  */
7
8 #include "defs.h"
9 #include <netinet/in.h>
10
11 #ifdef MCAST_JOIN_GROUP
12
13 # include DEF_MPERS_TYPE(struct_group_req)
14 typedef struct group_req struct_group_req;
15
16 #endif /* MCAST_JOIN_GROUP */
17
18 #include MPERS_DEFS
19
20 #ifdef MCAST_JOIN_GROUP
21
22 # include "print_fields.h"
23
24 MPERS_PRINTER_DECL(void, print_group_req, struct tcb *const tcp,
25                    const kernel_ulong_t addr, const int len)
26 {
27         struct_group_req greq;
28
29         if (len < (int) sizeof(greq)) {
30                 printaddr(addr);
31         } else if (!umove_or_printaddr(tcp, addr, &greq)) {
32                 PRINT_FIELD_IFINDEX("{", greq, gr_interface);
33                 PRINT_FIELD_SOCKADDR(", ", greq, gr_group);
34                 tprints("}");
35         }
36 }
37
38 #endif /* MCAST_JOIN_GROUP */