lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1387902787-257492-1-git-send-email-shawn@churchofgit.com>
Date:	Tue, 24 Dec 2013 16:33:07 +0000
From:	Shawn Landden <shawn@...rchofgit.com>
To:	unlisted-recipients:; (no To-header on input)
Cc:	criu@...nvz.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Shawn Landden <shawn@...rchofgit.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Alexander Viro <viro@...iv.linux.org.uk>
Subject: [PATCH] timerfd: show procfs fdinfo helper

| pos:	0
| flags:	02004002
| clockid:	0

Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Signed-off-by: Shawn Landden <shawn@...rchofgit.com>
---
 fs/timerfd.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/fs/timerfd.c b/fs/timerfd.c
index 9293121..e5fa587 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -25,6 +25,7 @@
 #include <linux/syscalls.h>
 #include <linux/compat.h>
 #include <linux/rcupdate.h>
+#include <linux/seq_file.h>
 
 struct timerfd_ctx {
 	union {
@@ -284,7 +285,23 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
 	return res;
 }
 
+#ifdef CONFIG_PROC_FS
+static int timerfd_show_fdinfo(struct seq_file *m, struct file *f)
+{
+	struct timerfd_ctx *ctx = f->private_data;
+	int clockid;
+
+	clockid = ctx->clockid;
+	seq_printf(m, "clockid:\t%d\n", clockid);
+
+	return 0;
+}
+#endif
+
 static const struct file_operations timerfd_fops = {
+#ifdef CONFIG_PROC_FS
+	.show_fdinfo	= timerfd_show_fdinfo,
+#endif
 	.release	= timerfd_release,
 	.poll		= timerfd_poll,
 	.read		= timerfd_read,
-- 
1.8.5.2.297.g3e57c29

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ