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.

reboot.c 882B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2014-2018 The strace developers.
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. */
  7. #include "defs.h"
  8. #include "xlat/bootflags1.h"
  9. #include "xlat/bootflags2.h"
  10. #include "xlat/bootflags3.h"
  11. SYS_FUNC(reboot)
  12. {
  13. const unsigned int magic1 = tcp->u_arg[0];
  14. const unsigned int magic2 = tcp->u_arg[1];
  15. const unsigned int cmd = tcp->u_arg[2];
  16. printxval(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???");
  17. tprints(", ");
  18. printxval(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???");
  19. tprints(", ");
  20. printxval(bootflags3, cmd, "LINUX_REBOOT_CMD_???");
  21. if (cmd == LINUX_REBOOT_CMD_RESTART2) {
  22. tprints(", ");
  23. /*
  24. * The size of kernel buffer is 256 bytes and
  25. * the last byte is always zero, at most 255 bytes
  26. * are copied from the user space.
  27. */
  28. printstr_ex(tcp, tcp->u_arg[3], 255, QUOTE_0_TERMINATED);
  29. }
  30. return RVAL_DECODED;
  31. }