summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-15 08:36:46 -0200
committerRenato Botelho <renato@netgate.com>2016-01-15 08:36:46 -0200
commit5118afa75776a41209a94f4a4ddf7c3164fac0df (patch)
treea899f605d0f0d9be1fb44d7a8d643a1233065dda /usr.bin
parent58b7eab7d39d983cc70f6f1d611f00470a76fca1 (diff)
parentce58d6dbf38815b68dedcf0559779e5ceb149a0d (diff)
downloadFreeBSD-src-5118afa75776a41209a94f4a4ddf7c3164fac0df.zip
FreeBSD-src-5118afa75776a41209a94f4a4ddf7c3164fac0df.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.c2
-rw-r--r--usr.bin/truss/syscall.h2
-rw-r--r--usr.bin/truss/syscalls.c36
3 files changed, 38 insertions, 2 deletions
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c
index 2f8bd96..bbcedd5 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.c
+++ b/usr.bin/cap_mkdb/cap_mkdb.c
@@ -119,7 +119,7 @@ main(int argc, char *argv[])
(void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);
if ((capname = strdup(buf)) == NULL)
errx(1, "strdup failed");
- if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
+ if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC,
DEFFILEMODE, DB_HASH, &openinfo)) == NULL)
err(1, "%s", buf);
diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h
index a240749..5af5ebc 100644
--- a/usr.bin/truss/syscall.h
+++ b/usr.bin/truss/syscall.h
@@ -43,7 +43,7 @@ enum Argtype { None = 1, Hex, Octal, Int, LongHex, Name, Ptr, Stat, Ioctl, Quad,
Umtx, Sigset, Sigprocmask, StatFs, Kevent, Sockdomain, Socktype, Open,
Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2,
Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl,
- LinuxSockArgs, Umtxop, Atfd, Atflags, Accessmode, Long,
+ LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long,
Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex };
#define ARG_MASK 0xff
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index 7815fd1..f7d8797 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -162,6 +162,8 @@ static struct syscall decoded_syscalls[] = {
.args = { { Int, 0 }, { StatFs | OUT, 1 } } },
{ .name = "ftruncate", .ret_type = 1, .nargs = 2,
.args = { { Int | IN, 0 }, { QuadHex | IN, 1 + QUAD_ALIGN } } },
+ { .name = "futimens", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Timespec2 | IN, 1 } } },
{ .name = "futimes", .ret_type = 1, .nargs = 2,
.args = { { Int, 0 }, { Timeval2 | IN, 1 } } },
{ .name = "futimesat", .ret_type = 1, .nargs = 3,
@@ -341,6 +343,9 @@ static struct syscall decoded_syscalls[] = {
.args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } },
{ .name = "unmount", .ret_type = 1, .nargs = 2,
.args = { { Name, 0 }, { Int, 1 } } },
+ { .name = "utimensat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timespec2 | IN, 2 },
+ { Atflags, 3 } } },
{ .name = "utimes", .ret_type = 1, .nargs = 2,
.args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } },
{ .name = "wait4", .ret_type = 1, .nargs = 4,
@@ -1083,6 +1088,37 @@ print_arg(struct syscall_args *sc, unsigned long *args, long *retval,
fprintf(fp, "0x%lx", args[sc->offset]);
break;
}
+ case Timespec2: {
+ struct timespec ts[2];
+ const char *sep;
+ unsigned int i;
+
+ if (get_struct(pid, (void *)args[sc->offset], &ts, sizeof(ts))
+ != -1) {
+ fputs("{ ", fp);
+ sep = "";
+ for (i = 0; i < nitems(ts); i++) {
+ fputs(sep, fp);
+ sep = ", ";
+ switch (ts[i].tv_nsec) {
+ case UTIME_NOW:
+ fprintf(fp, "UTIME_NOW");
+ break;
+ case UTIME_OMIT:
+ fprintf(fp, "UTIME_OMIT");
+ break;
+ default:
+ fprintf(fp, "%jd.%09ld",
+ (intmax_t)ts[i].tv_sec,
+ ts[i].tv_nsec);
+ break;
+ }
+ }
+ fputs(" }", fp);
+ } else
+ fprintf(fp, "0x%lx", args[sc->offset]);
+ break;
+ }
case Timeval: {
struct timeval tv;
OpenPOWER on IntegriCloud