strace/chmod.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

41 lines
616 B
C

/*
* Copyright (c) 2014-2018 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
static void
decode_chmod(struct tcb *tcp, const int offset)
{
printpath(tcp, tcp->u_arg[offset]);
tprints(", ");
print_numeric_umode_t(tcp->u_arg[offset + 1]);
}
SYS_FUNC(chmod)
{
decode_chmod(tcp, 0);
return RVAL_DECODED;
}
SYS_FUNC(fchmodat)
{
print_dirfd(tcp, tcp->u_arg[0]);
decode_chmod(tcp, 1);
return RVAL_DECODED;
}
SYS_FUNC(fchmod)
{
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
print_numeric_umode_t(tcp->u_arg[1]);
return RVAL_DECODED;
}