public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: Cygwin sysconf.cc
Date: Wed, 2 Mar 2022 21:35:23 +0100	[thread overview]
Message-ID: <Yh/VCzCrgxftws6+@calimero.vinschen.de> (raw)
In-Reply-To: <b7a385c3-5480-9881-9feb-7fb49350c755@SystematicSw.ab.ca>

On Mar  2 12:45, Brian Inglis wrote:
> On 2022-03-02 01:25, Corinna Vinschen wrote:
> > Hi Brian,
> > 
> > On Mar  1 13:20, Brian Inglis wrote:
> > > Interested in a patch for sysconf.cc to return:
> > > 
> > >       _SC_TZNAME_MAX => TZNAME_MAX and
> > > _SC_MONOTONIC_CLOCK => _POSIX_MONOTONIC_CLOCK?
> > 
> > not sure I understand the question.  Both are already implemented.
> > 
> >    $ getconf -a | egrep '(TZNAME_MAX|MONOTONIC_CLOCK)'
> >    _POSIX_TZNAME_MAX                   6
> >    TZNAME_MAX                          undefined
> >    _POSIX_MONOTONIC_CLOCK              200809
> 
> Sorry, must have been looking at very *OLD* version online, as
> _SC_CLOCK_SELECTION and _SC_MONOTONIC_CLOCK were not defined.
> 
> Why did you not define _SC_TZNAME_MAX => _POSIX_TZNAME_MAX when you tweaked
> it?

Because it's wrong.  _POSIX_TZNAME_MAX is just a minimum value required
by POSIX, not the correct value to return for TZNAME_MAX.

> My rereading of the man and POSIX pages leads me to believe that for all
> known values of _SC_... the entries now showing {nsup, {c:0}} should be
> {cons, {c:-1L}} supported but undefined, and only out of range values for
> the parameter should be treated as {nsup, {c:-1L}}?

These are really not undefined, but not supported on Cygwin.  That's
why they return with EINVAL.  I see what you mean, though, let me think
about it.

while looking into this I see at least one obvious bug.  While adding
POSIX per-process timers in 2019 I added a valid DELAYTIMER_MAX value,
but I neglected to add this to sysconf.  I'm going to fix this.


Corinna

  reply	other threads:[~2022-03-02 20:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220225163959.48753-1-Brian.Inglis@SystematicSW.ab.ca>
     [not found] ` <20220225163959.48753-3-Brian.Inglis@SystematicSW.ab.ca>
     [not found]   ` <Yhy6OKd/2o8VqIUH@calimero.vinschen.de>
     [not found]     ` <d71a5b05-531f-8028-7b06-6ee466053f5f@SystematicSw.ab.ca>
2022-03-01 20:20       ` Brian Inglis
2022-03-02  8:25         ` Corinna Vinschen
2022-03-02 19:45           ` Brian Inglis
2022-03-02 20:35             ` Corinna Vinschen [this message]
2022-03-02 21:04               ` Corinna Vinschen

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=Yh/VCzCrgxftws6+@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).