From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/2] pthread_create-14-1: avoid threads sharing stack
Date: Mon, 11 Dec 2017 15:38:50 +0100 [thread overview]
Message-ID: <20171211143850.GA12716@rei> (raw)
In-Reply-To: <3e635415d2f7fd5e79ade01df9214e083a28bc6b.1512568550.git.jstancek@redhat.com>
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.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-12-11 14:38 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 [this message]
2017-12-12 9:26 ` Jan Stancek
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=20171211143850.GA12716@rei \
--to=chrubis@suse.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox