summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/kdump/kdump.c95
-rw-r--r--usr.bin/kdump/kdump_subr.h3
-rw-r--r--usr.bin/kdump/mksubr5
3 files changed, 98 insertions, 5 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index e4ae0478176..8de69c1822d 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump.c,v 1.60 2011/07/17 07:49:34 otto Exp $ */
+/* $OpenBSD: kdump.c,v 1.61 2011/07/19 18:20:11 matthew Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -48,6 +48,7 @@
#include <ctype.h>
#include <err.h>
+#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -143,6 +144,7 @@ static void ktrsysret(struct ktr_sysret *);
static void ktrstruct(char *, size_t);
static void setemul(const char *);
static void usage(void);
+static void atfd(int);
int
main(int argc, char *argv[])
@@ -540,7 +542,7 @@ ktrsyscall(struct ktr_syscall *ktr)
break;
case SYS_chmod:
case SYS_fchmod:
- pn( NULL);
+ pn(NULL);
pn(modename);
break;
case SYS_fcntl: {
@@ -728,6 +730,84 @@ ktrsyscall(struct ktr_syscall *ktr)
pn(NULL);
pn(wait4optname);
break;
+ case SYS_faccessat:
+ pn(atfd);
+ pn(NULL);
+ pn(accessmodename);
+ pn(atflagsname);
+ break;
+ case SYS_fchmodat:
+ pn(atfd);
+ pn(NULL);
+ pn(modename);
+ pn(atflagsname);
+ break;
+ case SYS_fchownat:
+ pn(atfd);
+ pn(NULL);
+ pn(NULL);
+ pn(NULL);
+ pn(atflagsname);
+ break;
+ case SYS_fstatat:
+ pn(atfd);
+ pn(NULL);
+ pn(NULL);
+ pn(atflagsname);
+ break;
+ case SYS_linkat:
+ pn(atfd);
+ pn(NULL);
+ pn(atfd);
+ pn(NULL);
+ pn(atflagsname);
+ break;
+ case SYS_mkdirat:
+ case SYS_mkfifoat:
+ case SYS_mknodat:
+ pn(atfd);
+ pn(NULL);
+ pn(modename);
+ break;
+ case SYS_openat: {
+ int flags;
+ int mode;
+
+ pn(atfd);
+ pn(NULL);
+ if (!fancy)
+ break;
+ flags = ap[0];
+ mode = ap[1];
+ (void)putchar(',');
+ flagsandmodename(flags, mode);
+ ap += 2;
+ narg -= 2;
+ break;
+ }
+ case SYS_readlinkat:
+ pn(atfd);
+ break;
+ case SYS_renameat:
+ pn(atfd);
+ pn(NULL);
+ pn(atfd);
+ break;
+ case SYS_symlinkat:
+ pn(NULL);
+ pn(atfd);
+ break;
+ case SYS_unlinkat:
+ pn(atfd);
+ pn(NULL);
+ pn(atflagsname);
+ break;
+ case SYS_utimensat:
+ pn(atfd);
+ pn(NULL);
+ pn(NULL);
+ pn(atflagsname);
+ break;
}
nonnative:
@@ -1160,3 +1240,14 @@ setemul(const char *name)
}
warnx("Emulation `%s' unknown", name);
}
+
+static void
+atfd(int fd)
+{
+ if (fd == AT_FDCWD)
+ (void)printf("AT_FDCWD");
+ else if (decimal)
+ (void)printf("%d", fd);
+ else
+ (void)printf("%#x", fd);
+}
diff --git a/usr.bin/kdump/kdump_subr.h b/usr.bin/kdump/kdump_subr.h
index b08742ef538..36a1872b36e 100644
--- a/usr.bin/kdump/kdump_subr.h
+++ b/usr.bin/kdump/kdump_subr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump_subr.h,v 1.3 2011/07/08 19:29:44 otto Exp $ */
+/* $OpenBSD: kdump_subr.h,v 1.4 2011/07/19 18:20:12 matthew Exp $ */
/*
* Copyright(c) 2006 2006 David Kirchner <dpk@dpk.net>
*
@@ -25,6 +25,7 @@ void fcntlcmdname(int, int);
void rtprioname(int);
void modename(int);
void flagsname(int);
+void atflagsname(int);
void flagsandmodename(int, int);
void accessmodename(int);
void mmapprotname(int);
diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr
index 6652aa99a81..29150f81e9c 100644
--- a/usr.bin/kdump/mksubr
+++ b/usr.bin/kdump/mksubr
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: mksubr,v 1.5 2011/07/08 19:29:44 otto Exp $
+# $OpenBSD: mksubr,v 1.6 2011/07/19 18:20:12 matthew Exp $
#
# Copyright (c) 2006 David Kirchner <dpk@dpk.net>
#
@@ -334,6 +334,7 @@ _EOF_
auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h"
auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h"
+auto_or_type "atflagsname" "AT_[A-Z_]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h"
auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h"
auto_or_type "mmapprotname" "PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
auto_or_type "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
@@ -382,7 +383,7 @@ fcntlcmdname (int cmd, int arg)
{
switch (cmd) {
_EOF_
-egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z]+[[:space:]]+[0-9]+[[:space:]]*" \
+egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z_]+[[:space:]]+[0-9]+[[:space:]]*" \
$include_dir/sys/fcntl.h | \
awk 'BEGIN { o=0 } { for (i = 1; i <= NF; i++) \
if ($i ~ /define/) \