]> granicus.if.org Git - strace/blob - stat64.c
Update copyright headers
[strace] / stat64.c
1 /*
2  * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
3  * Copyright (c) 2015-2018 The strace developers.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: LGPL-2.1-or-later
7  */
8
9 #include "defs.h"
10 #include "stat.h"
11
12 static void
13 decode_struct_stat64(struct tcb *const tcp, const kernel_ulong_t addr)
14 {
15         struct strace_stat st;
16
17         if (fetch_struct_stat64(tcp, addr, &st))
18                 print_struct_stat(tcp, &st);
19 }
20
21 SYS_FUNC(stat64)
22 {
23         if (entering(tcp)) {
24                 printpath(tcp, tcp->u_arg[0]);
25                 tprints(", ");
26         } else {
27                 decode_struct_stat64(tcp, tcp->u_arg[1]);
28         }
29         return 0;
30 }
31
32 SYS_FUNC(fstat64)
33 {
34         if (entering(tcp)) {
35                 printfd(tcp, tcp->u_arg[0]);
36                 tprints(", ");
37         } else {
38                 decode_struct_stat64(tcp, tcp->u_arg[1]);
39         }
40         return 0;
41 }
42
43 SYS_FUNC(fstatat64)
44 {
45         if (entering(tcp)) {
46                 print_dirfd(tcp, tcp->u_arg[0]);
47                 printpath(tcp, tcp->u_arg[1]);
48                 tprints(", ");
49         } else {
50                 decode_struct_stat64(tcp, tcp->u_arg[2]);
51                 tprints(", ");
52                 printflags(at_flags, tcp->u_arg[3], "AT_???");
53         }
54         return 0;
55 }