All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] pthread_create-14-1: avoid threads sharing stack
Date: Tue, 12 Dec 2017 04:26:05 -0500 (EST)	[thread overview]
Message-ID: <1721839199.53982933.1513070765015.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20171211143850.GA12716@rei>



----- Original Message -----
> Hi!
> > +static unsigned long current_time_usec(void)
> > +{
> > +	struct timeval now;
> > +
> > +	SAFE_FUNC(gettimeofday(&now, NULL));
> > +	return now.tv_sec * 1000000 + now.tv_usec;
> > +}
> 
> Looking into this closely wouldn't this overflow on 32bit where
> sizeof(long) == 4 ?
> 
> So this functions has to return long long which should be 64 bit even on
> 32bit archs.
> 
> Sorry for not catching that in the first review.
> 
> 
> Acked with fix fix for the overflow.

Pushed with long long. I did same change to pthread_detach-4-3,
where I made the same mistake years ago.

I'm thinking if we could re-use include/tst_timer.h in open_posix tests.

Regards,
Jan

  reply	other threads:[~2017-12-12  9:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 14:05 [LTP] [PATCH v2 1/2] open_posix: add SAFE_FUNC macro Jan Stancek
2017-12-06 14:05 ` [LTP] [PATCH v2 2/2] pthread_create-14-1: avoid threads sharing stack Jan Stancek
2017-12-11 14:38   ` Cyril Hrubis
2017-12-12  9:26     ` Jan Stancek [this message]
2017-12-12  9:56       ` Cyril Hrubis

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=1721839199.53982933.1513070765015.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.