From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] [man-pages] adjtimex.2: document clock_adjtime Date: Tue, 21 Nov 2017 23:09:16 +0100 Message-ID: References: <20171120225302.3379657-1-arnd@arndb.de> <20171121030459.swng4eyke34uf3sv@localhost> <20171121160601.2xti5ho5pul2v7tm@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20171121160601.2xti5ho5pul2v7tm@localhost> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Richard Cochran Cc: Michael Kerrisk , Linux Kernel Mailing List , Linux API , John Stultz , Thomas Gleixner , Stephen Boyd List-Id: linux-api@vger.kernel.org On Tue, Nov 21, 2017 at 5:06 PM, Richard Cochran wrote: > On Tue, Nov 21, 2017 at 09:06:37AM +0100, Arnd Bergmann wrote: >> >> I copied that line from clock_gettime() man page. I suppose we want to >> fix change this in both pages, right? Any suggestions for a good way to >> express your explanation in the man page? I suppose we don't want to >> go into details of the implementation there but still capture the possible >> corner cases. > > Dynamic clockids are a Linux specific extension. This should be > explained with a paragraph or two on the gettime man page, along with > an example using the macros. > > #define CLOCKFD 3 > #define FD_TO_CLOCKID(fd) ((~(clockid_t) (fd) << 3) | CLOCKFD) > #define CLOCKID_TO_FD(clk) ((unsigned int) ~((clk) >> 3)) > > Then, the adjtimex page can say, see gettime. > > Let me try to come up with a text over the (USA) holiday weekend. Thanks! There is no rush here, take your time. One more question: I see that ptp_clock_adjtime doesn't call timekeeping_validate_timex(), so a number of the error conditions are not caught there. Should we document that as intended, or change it to behave the same way as do_adjtimex()? I also see that ptp_clock_adjtime() ignores all other flags whenever ADJ_SETOFFSET is set, while __do_adjtimex() can do ADJ_SETOFFSET and ADJ_FREQUENCY (or any other combination) in a single syscall, which matches what is documented in the man page. Arnd