public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: Aniruddha M Marathe <aniruddha.marathe@wipro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [BUG] settimeofday(2) succeeds for microsecond value more than USEC_PER_SEC and for negative value
Date: Sat, 12 Apr 2003 12:25:08 -0700	[thread overview]
Message-ID: <3E986814.4060606@mvista.com> (raw)
In-Reply-To: <94F20261551DC141B6B559DC491086723E10C2@blr-m3-msg.wipro.com>

Aniruddha M Marathe wrote:
> |Aniruddha M Marathe wrote:
> |> Even then, I think, we can modify the settimeofday  code to 
> |check -1 and USEC_PER_SEC
> |> Conditions, can't we?
> |> 
> 
> George wrote:
> 
> |Uh, sure.  This is the test I prefer:
> |
> |	if( (unsigned long)tv->usec > USEC_PER_SEC)
> |		return EINVAL;
> |
> |
> |This change should go in do_sys_settimeofday() in kernel/time.c.  It 
> |will fix both settimeofday and clock_settime(CLOCK_REALTIME,...  And 
> |also fixes it in all archs.
> |
> |-g
> 
> How about
> If( (unsigned long)tv->usec >= USEC_PER_SEC)
> 	return EINVAL;

Right, my mistake ;)
-g
> 
> Even if tv_usec value is 10^6, it should give EINVAL.
> Man page must also be updated
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml


  reply	other threads:[~2003-04-12 19:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-12 10:43 [BUG] settimeofday(2) succeeds for microsecond value more than USEC_PER_SEC and for negative value Aniruddha M Marathe
2003-04-12 19:25 ` george anzinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-11 13:07 Aniruddha M Marathe
2003-04-11 21:36 ` george anzinger
2003-05-02 18:06   ` Urs Thuermann
2003-04-11  5:12 Aniruddha M Marathe
2003-04-11  6:26 ` george anzinger

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=3E986814.4060606@mvista.com \
    --to=george@mvista.com \
    --cc=aniruddha.marathe@wipro.com \
    --cc=linux-kernel@vger.kernel.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