sgx_time.h 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _SGX_TIME_H
  6. #define _SGX_TIME_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #define CLOCK_REALTIME 0
  11. #define CLOCK_MONOTONIC 1
  12. #define CLOCK_PROCESS_CPUTIME_ID 2
  13. #define CLOCK_THREAD_CPUTIME_ID 3
  14. #define UTIME_NOW 0x3fffffff
  15. #define UTIME_OMIT 0x3ffffffe
  16. #define TIMER_ABSTIME 1
  17. typedef long int time_t;
  18. typedef int clockid_t;
  19. struct timespec {
  20. time_t tv_sec;
  21. long tv_nsec;
  22. };
  23. int
  24. clock_getres(int clock_id, struct timespec *res);
  25. int
  26. clock_gettime(clockid_t clock_id, struct timespec *tp);
  27. int
  28. utimensat(int dirfd, const char *pathname, const struct timespec times[2],
  29. int flags);
  30. int
  31. futimens(int fd, const struct timespec times[2]);
  32. int
  33. clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *request,
  34. struct timespec *remain);
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38. #endif /* end of _SGX_TIME_H */