]> granicus.if.org Git - strace/blob - print_sg_req_info.c
tests: workaround systemd-nspawn habit of disabling unimplemented syscalls
[strace] / print_sg_req_info.c
1 /*
2  * Decode struct sg_req_info.
3  *
4  * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
5  * All rights reserved.
6  *
7  * SPDX-License-Identifier: LGPL-2.1-or-later
8  */
9
10 #include "defs.h"
11
12 #ifdef HAVE_SCSI_SG_H
13
14 # include DEF_MPERS_TYPE(struct_sg_req_info)
15
16 # include <scsi/sg.h>
17
18 typedef struct sg_req_info struct_sg_req_info;
19
20 #endif /* HAVE_SCSI_SG_H */
21
22 #include MPERS_DEFS
23
24 #ifdef HAVE_SCSI_SG_H
25
26 MPERS_PRINTER_DECL(int, decode_sg_req_info,
27                    struct tcb *const tcp, const kernel_ulong_t arg)
28 {
29         struct_sg_req_info info;
30
31         if (entering(tcp))
32                 return 0;
33
34         tprints(", ");
35         if (!umove_or_printaddr(tcp, arg, &info)) {
36                 tprintf("{req_state=%hhd"
37                         ", orphan=%hhd"
38                         ", sg_io_owned=%hhd"
39                         ", problem=%hhd"
40                         ", pack_id=%d"
41                         ", usr_ptr=",
42                         info.req_state,
43                         info.orphan,
44                         info.sg_io_owned,
45                         info.problem,
46                         info.pack_id);
47                 printaddr(ptr_to_kulong(info.usr_ptr));
48                 tprintf(", duration=%u}", info.duration);
49         }
50
51         return RVAL_IOCTL_DECODED;
52 }
53
54 #endif /* HAVE_SCSI_SG_H */