source:
rtems/cpukit/score/src/timespeclessthan.c
@
5472ad41
Last change on this file since 5472ad41 was 28352fae, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/29/09 at 13:51:53 | |
---|---|
|
|
File size: 785 bytes |
Rev | Line | |
---|---|---|
[28352fae] | 1 | /** |
[412dbff6] | 2 | * @file score/src/timespeclessthan.c |
3 | */ | |
4 | ||
5 | /* | |
6 | * COPYRIGHT (c) 1989-2007. | |
7 | * On-Line Applications Research Corporation (OAR). | |
8 | * | |
9 | * The license and distribution terms for this file may be | |
10 | * found in the file LICENSE in this distribution or at | |
11 | * http://www.rtems.com/license/LICENSE. | |
12 | * | |
13 | * $Id$ | |
14 | */ | |
15 | ||
16 | #if HAVE_CONFIG_H | |
17 | #include "config.h" | |
18 | #endif | |
19 | ||
20 | #include <sys/types.h> | |
21 | ||
22 | #include <rtems/system.h> | |
23 | #include <rtems/score/timespec.h> | |
24 | #include <rtems/score/tod.h> | |
25 | ||
[484a769] | 26 | bool _Timespec_Less_than( |
[412dbff6] | 27 | const struct timespec *lhs, |
28 | const struct timespec *rhs | |
29 | ) | |
30 | { | |
31 | if ( lhs->tv_sec < rhs->tv_sec ) | |
[aae7f1a1] | 32 | return true; |
[412dbff6] | 33 | |
34 | if ( lhs->tv_sec > rhs->tv_sec ) | |
[aae7f1a1] | 35 | return false; |
[412dbff6] | 36 | |
37 | /* ASSERT: lhs->tv_sec == rhs->tv_sec */ | |
38 | if ( lhs->tv_nsec < rhs->tv_nsec ) | |
[28352fae] | 39 | return true; |
[412dbff6] | 40 | |
[aae7f1a1] | 41 | return false; |
[412dbff6] | 42 | } |
Note: See TracBrowser
for help on using the repository browser.