sgx_time.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 clock_getres(int clock_id, struct timespec *res);
  24. int clock_gettime(clockid_t clock_id, struct timespec *tp);
  25. int utimensat(int dirfd, const char *pathname,
  26. const struct timespec times[2], int flags);
  27. int futimens(int fd, const struct timespec times[2]);
  28. int clock_nanosleep(clockid_t clock_id, int flags,
  29. const struct timespec *request,
  30. struct timespec *remain);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif /* end of _SGX_TIME_H */