Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Aug 2013 02:57:05 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253850 - head/usr.bin/truss
Message-ID:  <201308010257.r712v5SB013255@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Thu Aug  1 02:57:04 2013
New Revision: 253850
URL: http://svnweb.freebsd.org/changeset/base/253850

Log:
  Properly print arguments to vfork(2) and rfork(2).
  
  PR:		180976
  Submitted by:	Yuri <yuri@tsoft.com> (original patch)
  MFC after:	1 week

Modified:
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscall.h
==============================================================================
--- head/usr.bin/truss/syscall.h	Thu Aug  1 01:18:51 2013	(r253849)
+++ head/usr.bin/truss/syscall.h	Thu Aug  1 02:57:04 2013	(r253850)
@@ -40,7 +40,7 @@ enum Argtype { None = 1, Hex, Octal, Int
 	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

Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c	Thu Aug  1 01:18:51 2013	(r253849)
+++ head/usr.bin/truss/syscalls.c	Thu Aug  1 02:57:04 2013	(r253850)
@@ -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, unsig
 	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];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308010257.r712v5SB013255>