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
This commit is contained in:

committed by
Thomas Gleixner

parent
70ddf65184
commit
04a8682a71
@@ -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 = ¤t->nsproxy->time_ns->offsets;
|
||||
|
Reference in New Issue
Block a user