File: timeval.h

package info (click to toggle)
superkb 0.23-5
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 492 kB
  • sloc: ansic: 3,915; sh: 187; makefile: 182
file content (36 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * timeval.h
 *
 * Copyright (C) 2006, Octavio Alvarez Piza.
 * License: GNU General Public License v2.
 *
 */

/* timeval.h: This provides with some timeval functions if not provided
 *            by the system.
 */

#ifndef __TIMEVAL_H
#define __TIMEVAL_H

#ifndef _GNU_SOURCE

#include <sys/time.h>

void
timersub(struct timeval *a, struct timeval *b, struct timeval *res);

int
timerisset(struct timeval *tv);

void
timerclear(struct timeval *tv);

#define timercmp(a, b, CMP) \
	(((a)->tv_sec == (b)->tv_sec) ? \
		((a)->tv_usec CMP (b)->tv_usec) \
		: ((a)->tv_sec CMP (b)->tv_sec))

#endif /* #ifndef _GNU_SOURCE */

#endif