linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Lefevre <vincent-buymaDBGzMOsTnJN9+BGXg@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: timegm(3): behavior is not described in case of error
Date: Tue, 25 Oct 2016 14:58:16 +0200	[thread overview]
Message-ID: <20161025125816.GA29678@cventin.lip.ens-lyon.fr> (raw)

In the timegm(3) man page, the behavior is not described in case of
error, i.e. if the result is not representable in a time_t (e.g.,
with a huge year).

The glibc manual says:

     'timegm' is functionally identical to 'mktime' except it always
     takes the input values to be Coordinated Universal Time (UTC)
     regardless of any local time zone setting.

So, I assume that (time_t) -1 is returned in such a case, just like
mktime.

The man page could add a sentence like the glibc manual one, or
explicitly say what happens in case of error like in the mktime(3)
man page.

This is mainly for the timegm() function. For the timelocal() function,
the man page already says:

    The timelocal() function is equivalent to the POSIX standard
    function mktime(3). [...]

-- 
Vincent Lefèvre <vincent-buymaDBGzMOsTnJN9+BGXg@public.gmane.org> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2016-10-25 12:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 12:58 Vincent Lefevre [this message]
     [not found] ` <20161025125816.GA29678-d/FE5ZiCopwvkDgRb4gLyeMIjtZQB4uX@public.gmane.org>
2016-11-06 11:30   ` timegm(3): behavior is not described in case of error 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=20161025125816.GA29678@cventin.lip.ens-lyon.fr \
    --to=vincent-buymadbgzmostnjn9+bgxg@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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).