svn commit: r286849 - head/usr.bin/truss
John Baldwin
jhb at FreeBSD.org
Mon Aug 17 17:57:02 UTC 2015
Author: jhb
Date: Mon Aug 17 17:57:01 2015
New Revision: 286849
URL: https://svnweb.freebsd.org/changeset/base/286849
Log:
Decode the optional SOCK_NONBLOCK and SOCK_CLOEXEC flags passed in a
socket type.
Modified:
head/usr.bin/truss/syscalls.c
Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c Mon Aug 17 17:52:28 2015 (r286848)
+++ head/usr.bin/truss/syscalls.c Mon Aug 17 17:57:01 2015 (r286849)
@@ -1228,9 +1228,22 @@ print_arg(struct syscall_args *sc, unsig
case Sockdomain:
tmp = strdup(xlookup(sockdomain_arg, args[sc->offset]));
break;
- case Socktype:
- tmp = strdup(xlookup(socktype_arg, args[sc->offset]));
+ case Socktype: {
+ FILE *fp;
+ size_t len;
+ int type, flags;
+
+ flags = args[sc->offset] & (SOCK_CLOEXEC | SOCK_NONBLOCK);
+ type = args[sc->offset] & ~flags;
+ fp = open_memstream(&tmp, &len);
+ fputs(xlookup(socktype_arg, type), fp);
+ if (flags & SOCK_CLOEXEC)
+ fprintf(fp, "|SOCK_CLOEXEC");
+ if (flags & SOCK_NONBLOCK)
+ fprintf(fp, "|SOCK_NONBLOCK");
+ fclose(fp);
break;
+ }
case Shutdown:
tmp = strdup(xlookup(shutdown_arg, args[sc->offset]));
break;
More information about the svn-src-all
mailing list