strace/access.c
Dmitry V. Levin 92e347b556 Add copyright headers to some files that lack them
We do our best to keep copyright headers up to date, yet
git history provides better information on this subject
and is more accurate than copyright headers.
2018-12-24 23:46:43 +00:00

34 lines
538 B
C

/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include <fcntl.h>
#include "xlat/access_flags.h"
static int
decode_access(struct tcb *tcp, int offset)
{
printpath(tcp, tcp->u_arg[offset]);
tprints(", ");
printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
return RVAL_DECODED;
}
SYS_FUNC(access)
{
return decode_access(tcp, 0);
}
SYS_FUNC(faccessat)
{
print_dirfd(tcp, tcp->u_arg[0]);
return decode_access(tcp, 1);
}