linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Andrey Vagin <avagin@openvz.org>, Dmitry Safonov <dima@arista.com>
Cc: mtk.manpages@gmail.com, Linux API <linux-api@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Containers <containers@lists.linux-foundation.org>,
	Christian Brauner <christian@brauner.io>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	Andrey Vagin <avagin@openvz.org>, Adrian Reber <adrian@lisas.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andy Lutomirski <luto@kernel.org>
Subject: A further though on /proc/PID/timens_offsets
Date: Tue, 7 Apr 2020 15:24:13 +0200	[thread overview]
Message-ID: <703440af-031c-16b5-c1ff-54fb4bb5e10c@gmail.com> (raw)

Hello Dmitry, Andrei,

Quoting the draft time_namespaces manual page:

       Associated with each time namespace are  offsets,  expressed  with
       respect  to  the initial time namespace, that define the values of
       the monotonic and boot-time clocks in that namespace.  These  off‐
       sets  are  exposed  via the file /proc/PID/timens_offsets.  Within
       this file, the offsets are expressed as lines consisting of  three
       space-delimited fields:

           <clock-id> <offset-secs> <offset-nanosecs>

       The  clock-id  identifies the clock whose offsets are being shown.
       This field is either 1, for CLOCK_MONOTONIC, or 7, for CLOCK_BOOT‐
       TIME.

What was the reason for exposing numeric clock IDs in the
timens_offsets file? In API terms, that seems a little ugly.

I think it would have been much nicer if the clocks were defined
symbolically in this file. I.e., that reading the file would have
shown something like

monotonic    x    y
boottime     x    y

And that records similarly with symbolic clock names could have
been written to the file. Was there a reason not to do this?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

             reply	other threads:[~2020-04-07 13:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 13:24 Michael Kerrisk (man-pages) [this message]
2020-04-09 19:17 ` A further though on /proc/PID/timens_offsets Andrey Vagin
2020-04-09 21:32   ` Eric W. Biederman
2020-04-10  5:23     ` Andrey Vagin
2020-04-10  5:27       ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=703440af-031c-16b5-c1ff-54fb4bb5e10c@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=0x7f454c46@gmail.com \
    --cc=adrian@lisas.de \
    --cc=avagin@openvz.org \
    --cc=christian@brauner.io \
    --cc=containers@lists.linux-foundation.org \
    --cc=dima@arista.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).