Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / ostime.h
blob5ae8397f35a375a8db69058eb41074c784530362
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
5 #ifndef LIBRARIES_NACL_IO_OSTIME_H_
6 #define LIBRARIES_NACL_IO_OSTIME_H_
8 #if defined(WIN32)
10 #include <pthread.h>
12 #ifndef CLOCK_REALTIME
13 #define CLOCK_REALTIME (clockid_t)1
14 #endif
16 int clock_gettime(clockid_t clock_id, struct timespec* tp);
17 int clock_settime(clockid_t clock_id, const struct timespec* tp);
19 #else
21 #include <time.h>
22 #include <utime.h>
23 #include <sys/time.h>
25 #if defined(__GLIBC__)
26 #define st_atimensec st_atim.tv_nsec
27 #define st_mtimensec st_mtim.tv_nsec
28 #define st_ctimensec st_ctim.tv_nsec
29 #endif
31 #if defined(__APPLE__) && !defined(_POSIX_C_SOURCE)
32 #define st_atimensec st_atimespec.tv_nsec
33 #define st_mtimensec st_mtimespec.tv_nsec
34 #define st_ctimensec st_ctimespec.tv_nsec
35 #endif
37 #endif
39 #endif /* LIBRARIES_NACL_IO_OSUNISTD_H_ */