summaryrefslogtreecommitdiff
path: root/include/linux/time_namespace.h
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@gmail.com>2019-11-12 04:27:16 +0300
committerThomas Gleixner <tglx@linutronix.de>2020-01-14 14:20:59 +0300
commit04a8682a71becdb639ec9c0d82b315a2baef7a5d (patch)
tree5aed3bbe75988c14609c60129d3d7efda79f07fe /include/linux/time_namespace.h
parent70ddf65184ec1e8989322f35193e4fde7377f0cc (diff)
downloadlinux-04a8682a71becdb639ec9c0d82b315a2baef7a5d.tar.xz
fs/proc: Introduce /proc/pid/timens_offsets
API to set time namespace offsets for children processes, i.e.: echo "$clockid $offset_sec $offset_nsec" > /proc/self/timens_offsets Co-developed-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com> Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20191112012724.250792-28-dima@arista.com
Diffstat (limited to 'include/linux/time_namespace.h')
-rw-r--r--include/linux/time_namespace.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/time_namespace.h b/include/linux/time_namespace.h
index 04a2ba8b8a06..824d54e057eb 100644
--- a/include/linux/time_namespace.h
+++ b/include/linux/time_namespace.h
@@ -52,6 +52,16 @@ static inline void put_time_ns(struct time_namespace *ns)
kref_put(&ns->kref, free_time_ns);
}
+void proc_timens_show_offsets(struct task_struct *p, struct seq_file *m);
+
+struct proc_timens_offset {
+ int clockid;
+ struct timespec64 val;
+};
+
+int proc_timens_set_offset(struct file *file, struct task_struct *p,
+ struct proc_timens_offset *offsets, int n);
+
static inline void timens_add_monotonic(struct timespec64 *ts)
{
struct timens_offsets *ns_offsets = &current->nsproxy->time_ns->offsets;