summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/defs.h9
-rw-r--r--src/ioctl.c13
-rw-r--r--src/util.c2
3 files changed, 22 insertions, 2 deletions
diff --git a/src/defs.h b/src/defs.h
index 1b5f90e01..3a2bdcfae 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -671,6 +671,9 @@ struct finfo {
} dev;
};
+extern struct finfo *
+get_finfo_for_dev(const char *path, struct finfo *finfo);
+
/**
* @return 0 on success, -1 on error.
*/
@@ -1240,6 +1243,12 @@ printfd(struct tcb *tcp, int fd)
printfd_pid(tcp, tcp->pid, fd);
}
+static inline void
+printfd_with_finfo(struct tcb *tcp, int fd, const struct finfo *finfo)
+{
+ printfd_pid_with_finfo(tcp, tcp->pid, fd, finfo);
+}
+
/**
* Helper function, converts pid to string, or to "self" for pid == 0.
* Uses static buffer for operation.
diff --git a/src/ioctl.c b/src/ioctl.c
index ac271970e..5cb3d9df5 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -437,7 +437,18 @@ SYS_FUNC(ioctl)
int ret;
if (entering(tcp)) {
- printfd(tcp, tcp->u_arg[0]);
+ struct finfo finfoa;
+ struct finfo *finfo = NULL;
+ char path[PATH_MAX + 1];
+ bool deleted;
+ if (getfdpath_pid(tcp->pid, tcp->u_arg[0], path, sizeof(path),
+ &deleted) >= 0) {
+ finfo = get_finfo_for_dev(path, &finfoa);
+ finfo->deleted = deleted;
+ printfd_with_finfo(tcp, tcp->u_arg[0], finfo);
+ } else
+ printfd(tcp, tcp->u_arg[0]);
+
tprint_arg_next();
if (xlat_verbosity != XLAT_STYLE_ABBREV)
diff --git a/src/util.c b/src/util.c
index 06609ab24..2ecb0ec19 100644
--- a/src/util.c
+++ b/src/util.c
@@ -647,7 +647,7 @@ printsocket(struct tcb *tcp, int fd, const char *path)
return true;
}
-static struct finfo *
+struct finfo *
get_finfo_for_dev(const char *path, struct finfo *finfo)
{
strace_stat_t st;