Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

print_time.c 580B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2015-2016 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. #include "defs.h"
  9. #include DEF_MPERS_TYPE(time_t)
  10. #include MPERS_DEFS
  11. SYS_FUNC(time)
  12. {
  13. if (exiting(tcp)) {
  14. time_t t;
  15. if (!umove_or_printaddr(tcp, tcp->u_arg[0], &t)) {
  16. tprintf("[%lld", (long long) t);
  17. tprints_comment(sprinttime(t));
  18. tprints("]");
  19. }
  20. if (!syserror(tcp)) {
  21. tcp->auxstr = sprinttime((time_t) tcp->u_rval);
  22. return RVAL_STR;
  23. }
  24. }
  25. return 0;
  26. }