Changeset 0a0dff8 in mainline
- Timestamp:
- 2018-06-25T18:56:05Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d73d992
- Parents:
- 826a0a97
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/time.c
r826a0a97 r0a0dff8 51 51 #include <loc.h> 52 52 #include <device/clock_dev.h> 53 #include <thread.h>54 53 55 54 #define ASCTIME_BUF_LEN 26 … … 487 486 * @param tv2 Second timeval. 488 487 */ 489 void tv_add(struct timeval *tv1, struct timeval *tv2)488 void tv_add(struct timeval *tv1, const struct timeval *tv2) 490 489 { 491 490 tv1->tv_sec += tv2->tv_sec; … … 503 502 * 504 503 */ 505 suseconds_t tv_sub_diff( struct timeval *tv1,struct timeval *tv2)504 suseconds_t tv_sub_diff(const struct timeval *tv1, const struct timeval *tv2) 506 505 { 507 506 return (tv1->tv_usec - tv2->tv_usec) + … … 515 514 * 516 515 */ 517 void tv_sub(struct timeval *tv1, struct timeval *tv2)516 void tv_sub(struct timeval *tv1, const struct timeval *tv2) 518 517 { 519 518 tv1->tv_sec -= tv2->tv_sec; … … 531 530 * 532 531 */ 533 int tv_gt( struct timeval *tv1,struct timeval *tv2)532 int tv_gt(const struct timeval *tv1, const struct timeval *tv2) 534 533 { 535 534 if (tv1->tv_sec > tv2->tv_sec) … … 551 550 * 552 551 */ 553 int tv_gteq( struct timeval *tv1,struct timeval *tv2)552 int tv_gteq(const struct timeval *tv1, const struct timeval *tv2) 554 553 { 555 554 if (tv1->tv_sec > tv2->tv_sec) -
uspace/lib/c/include/sys/time.h
r826a0a97 r0a0dff8 69 69 }; 70 70 71 #define TIMEVAL_MAX ((struct timeval) { .tv_sec = LONG_MAX, .tv_usec = 999999 }) 72 71 73 struct timezone { 72 74 int tz_minuteswest; /* minutes W of Greenwich */ … … 75 77 76 78 extern void tv_add_diff(struct timeval *, suseconds_t); 77 extern void tv_add(struct timeval *, struct timeval *);78 extern suseconds_t tv_sub_diff( struct timeval *,struct timeval *);79 extern void tv_sub(struct timeval *, struct timeval *);80 extern int tv_gt( struct timeval *,struct timeval *);81 extern int tv_gteq( struct timeval *,struct timeval *);79 extern void tv_add(struct timeval *, const struct timeval *); 80 extern suseconds_t tv_sub_diff(const struct timeval *, const struct timeval *); 81 extern void tv_sub(struct timeval *, const struct timeval *); 82 extern int tv_gt(const struct timeval *, const struct timeval *); 83 extern int tv_gteq(const struct timeval *, const struct timeval *); 82 84 extern void gettimeofday(struct timeval *, struct timezone *); 83 85 extern void getuptime(struct timeval *);
Note:
See TracChangeset
for help on using the changeset viewer.