strace/print_time.c
Dmitry V. Levin b93d52fe3d Change the license of strace to LGPL-2.1-or-later
strace is now provided under the terms of the GNU Lesser General
Public License version 2.1 or later, see COPYING for more details.

strace test suite is now provided under the terms of the GNU General
Public License version 2 or later, see tests/COPYING for more details.
2018-12-10 00:00:00 +00:00

35 lines
580 B
C

/*
* Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
* Copyright (c) 2015-2017 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include DEF_MPERS_TYPE(time_t)
#include MPERS_DEFS
SYS_FUNC(time)
{
if (exiting(tcp)) {
time_t t;
if (!umove_or_printaddr(tcp, tcp->u_arg[0], &t)) {
tprintf("[%lld", (long long) t);
tprints_comment(sprinttime(t));
tprints("]");
}
if (!syserror(tcp)) {
tcp->auxstr = sprinttime((time_t) tcp->u_rval);
return RVAL_STR;
}
}
return 0;
}