blob: 292a061584af6e96ad88b994bbc190ddf3e3ba8e [file] [log] [blame]
Dmitry V. Levin38a34c92015-12-17 17:56:48 +00001/*
2 * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
3 * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
4 * Copyright (c) 2007 Daniel Jacobowitz <dan@codesourcery.com>
5 * Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
6 * Copyright (c) 2009 Kirill A. Shutemov <kirill@shutemov.name>
7 * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@altlinux.org>
Elliott Hughes39bac052017-05-25 16:56:11 -07008 * Copyright (c) 2014-2017 The strace developers.
Dmitry V. Levin38a34c92015-12-17 17:56:48 +00009 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000034#include "defs.h"
35
36#include <fcntl.h>
37
38#include "xlat/advise.h"
39
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000040SYS_FUNC(fadvise64)
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000041{
Dmitry V. Levin429c6772015-07-20 13:55:47 +000042 int argn;
43
44 printfd(tcp, tcp->u_arg[0]);
45 argn = printllval(tcp, ", %lld", 1);
Elliott Hughesd35df492017-02-15 15:19:05 -080046 tprintf(", %" PRI_klu ", ", tcp->u_arg[argn++]);
Dmitry V. Levin429c6772015-07-20 13:55:47 +000047 printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
48
49 return RVAL_DECODED;
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000050}
51
Dmitry V. Levina0bd3742015-04-07 01:36:50 +000052SYS_FUNC(fadvise64_64)
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000053{
Dmitry V. Levin429c6772015-07-20 13:55:47 +000054 int argn;
55
56 printfd(tcp, tcp->u_arg[0]);
57 argn = printllval(tcp, ", %lld, ", 1);
58 argn = printllval(tcp, "%lld, ", argn);
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000059#if defined __ARM_EABI__ || defined AARCH64 || defined POWERPC || defined XTENSA
Dmitry V. Levin429c6772015-07-20 13:55:47 +000060 printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000061#else
Dmitry V. Levin429c6772015-07-20 13:55:47 +000062 printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000063#endif
Dmitry V. Levin429c6772015-07-20 13:55:47 +000064
65 return RVAL_DECODED;
Dmitry V. Levin63f28dd2014-12-06 03:53:16 +000066}