summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2013-08-01 02:57:04 +0000
committermarkj <markj@FreeBSD.org>2013-08-01 02:57:04 +0000
commit5d2ce17ff01a410d5962062771ae1e121fbd92c1 (patch)
tree19f05244dd41488b6887e9253fd44d37fd192a4e /usr.bin
parent045ef38328f828a12a923239928c0e5c78ec93d1 (diff)
downloadFreeBSD-src-5d2ce17ff01a410d5962062771ae1e121fbd92c1.zip
FreeBSD-src-5d2ce17ff01a410d5962062771ae1e121fbd92c1.tar.gz
Properly print arguments to vfork(2) and rfork(2).
PR: 180976 Submitted by: Yuri <yuri@tsoft.com> (original patch) MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/truss/syscall.h2
-rw-r--r--usr.bin/truss/syscalls.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h
index 49ff9a4..94776a0 100644
--- a/usr.bin/truss/syscall.h
+++ b/usr.bin/truss/syscall.h
@@ -40,7 +40,7 @@ enum Argtype { None = 1, Hex, Octal, Int, Name, Ptr, Stat, Ioctl, Quad,
Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres,
Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open,
Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2,
- Pathconf };
+ Pathconf, Rforkflags };
#define ARG_MASK 0xff
#define OUT 0x100
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index 1a9c4de..6668d7c 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -93,6 +93,9 @@ static struct syscall syscalls[] = {
{ .name = "fcntl", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 } , { Fcntl, 1 }, { Fcntlflag | OUT, 2 } } },
{ .name = "fork", .ret_type = 1, .nargs = 0 },
+ { .name = "vfork", .ret_type = 1, .nargs = 0 },
+ { .name = "rfork", .ret_type = 1, .nargs = 1,
+ .args = { { Rforkflags, 0 } } },
{ .name = "getegid", .ret_type = 1, .nargs = 0 },
{ .name = "geteuid", .ret_type = 1, .nargs = 0 },
{ .name = "getgid", .ret_type = 1, .nargs = 0 },
@@ -369,6 +372,11 @@ static struct xlat pathconf_arg[] = {
XEND
};
+static struct xlat rfork_flags[] = {
+ X(RFPROC) X(RFNOWAIT) X(RFFDG) X(RFCFDG) X(RFTHREAD) X(RFMEM)
+ X(RFSIGSHARE) X(RFTSIGZMB) X(RFLINUXTHPN) XEND
+};
+
#undef X
#undef XEND
@@ -906,6 +914,9 @@ print_arg(struct syscall_args *sc, unsigned long *args, long retval,
case Pathconf:
tmp = strdup(xlookup(pathconf_arg, args[sc->offset]));
break;
+ case Rforkflags:
+ tmp = strdup(xlookup_bits(rfork_flags, args[sc->offset]));
+ break;
case Sockaddr: {
struct sockaddr_storage ss;
char addr[64];
OpenPOWER on IntegriCloud