From 4152441f440f4a5a34fdf32b9c1e572cd4769f1c Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 10 Jun 2017 01:22:40 +0000 Subject: [PATCH] Decode the 'howto' argument to reboot(). --- usr.bin/truss/syscall.h | 2 +- usr.bin/truss/syscalls.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index e3737ccbfa1d..5b4fb4d61629 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -50,7 +50,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHex, Name, Ptr, Stat, Ioctl, Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, - Ptraceop, Quotactlcmd, + Ptraceop, Quotactlcmd, Reboothowto, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 9373f70625c5..befb2a701fbf 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -375,6 +375,8 @@ static struct syscall decoded_syscalls[] = { { .name = "readlinkat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 }, { Sizet, 3 } } }, + { .name = "reboot", .ret_type = 1, .nargs = 1, + .args = { { Reboothowto, 0 } } }, { .name = "recvfrom", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, { Msgflags, 3 }, { Sockaddr | OUT, 4 }, @@ -2142,6 +2144,9 @@ print_arg(struct syscall_args *sc, unsigned long *args, long *retval, if (!sysdecode_quotactl_cmd(fp, args[sc->offset])) fprintf(fp, "%#x", (int)args[sc->offset]); break; + case Reboothowto: + print_mask_arg(sysdecode_reboot_howto, fp, args[sc->offset]); + break; case CloudABIAdvice: fputs(xlookup(cloudabi_advice, args[sc->offset]), fp);