unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: Lukasz Majewski <lukma@denx.de>
Cc: Florian Weimer <fweimer@redhat.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Andreas Schwab <schwab@suse.de>,
	Stepan Golosunov <stepan@golosunov.pp.ru>,
	Alistair Francis <alistair.francis@wdc.com>,
	Joseph Myers <joseph@codesourcery.com>
Subject: Re: [PATCH] nptl: Handle NULL abstime [BZ #26394]
Date: Mon, 17 Aug 2020 06:52:43 -0700	[thread overview]
Message-ID: <CAMe9rOpJaMOpAf_G+9q3ujmMgfOR1Wpi+eM7GVmea8RRRLCviw@mail.gmail.com> (raw)
In-Reply-To: <20200817153019.6d86b10c@jawa>

On Mon, Aug 17, 2020 at 6:30 AM Lukasz Majewski <lukma@denx.de> wrote:
>
> Hi Andreas, H.J.,
>
> > On Aug 15 2020, H.J. Lu wrote:
> >
> > > From fa1f97680fca290a378c449f2b63682ee348fd2c Mon Sep 17 00:00:00
> > > 2001 From: "H.J. Lu" <hjl.tools@gmail.com>
> > > Date: Sat, 15 Aug 2020 11:06:35 -0700
> > > Subject: [PATCH] nptl: Handle NULL abstime [BZ #26394]
> > >
> > > Since abstime passed to pthread_{clock|timed}join_np may be NULL,
>
> Could you point me to the exact reference that it is allowed (or
> required) to pass NULL to this syscall?
>
> The one which I've found on the web:
> https://linux.die.net/man/3/pthread_timedjoin_np
>
> doesn't mention about NULL pointer passed as the absolute time.
> It says explicitly:
> "The abstime argument is a structure of the following form, specifying
> an absolute time measured since the Epoch"
>
>
> As fair as I remember [1] glibc only handles the NULL pointer case when
> it is explicitly written in the documentation/spec that NULL is passed
> (like here: https://linux.die.net/man/2/timerfd_settime or here:
> https://linux.die.net/man/2/utimensat).
>
> Link:
> [1] -
> https://sourceware.org/pipermail/libc-alpha/2019-November/108072.html
>

sysdeps/pthread/tst-join14.c explicitly passes NULL:

static int
do_test_clock (clockid_t clockid)
{
  pthread_t th = xpthread_create (NULL, tf, NULL);

  void *status;
  int val = (clockid == CLOCK_USE_TIMEDJOIN)
    ? pthread_timedjoin_np (th, &status, NULL)
    : pthread_clockjoin_np (th, &status, clockid, NULL);
  TEST_COMPARE (val, 0);

  if (status != (void *) 42l)
    FAIL_EXIT1 ("return value %p, expected %p\n", status, (void *) 42l);

  return 0;
}

-- 
H.J.

  reply	other threads:[~2020-08-17 13:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 10:22 [PATCH v5] y2038: nptl: Convert pthread_{clock|timed}join_np to support 64 bit time Lukasz Majewski
2020-08-12 21:54 ` Alistair Francis via Libc-alpha
2020-08-12 23:11 ` Adhemerval Zanella via Libc-alpha
2020-08-15 18:11 ` [PATCH] nptl: Handle NULL abstime [BZ #26394] H.J. Lu via Libc-alpha
2020-08-17 10:22   ` Andreas Schwab
2020-08-17 12:04     ` H.J. Lu via Libc-alpha
2020-08-17 13:30     ` Lukasz Majewski
2020-08-17 13:52       ` H.J. Lu via Libc-alpha [this message]
2020-08-17 13:58         ` Adhemerval Zanella via Libc-alpha
2020-08-17 14:24           ` Lukasz Majewski

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=CAMe9rOpJaMOpAf_G+9q3ujmMgfOR1Wpi+eM7GVmea8RRRLCviw@mail.gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=alistair.francis@wdc.com \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=joseph@codesourcery.com \
    --cc=lukma@denx.de \
    --cc=schwab@suse.de \
    --cc=stepan@golosunov.pp.ru \
    /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).