1 /**************************************************************************/ 2 /* */ 3 /* Copyright (c) Microsoft Corporation. All rights reserved. */ 4 /* */ 5 /* This software is licensed under the Microsoft Software License */ 6 /* Terms for Microsoft Azure RTOS. Full text of the license can be */ 7 /* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ 8 /* and in the root directory of this software. */ 9 /* */ 10 /**************************************************************************/ 11 12 /**************************************************************************/ 13 /**************************************************************************/ 14 /** */ 15 /** ThreadX Component */ 16 /** */ 17 /** POSIX Compliancy Wrapper (POSIX) */ 18 /** */ 19 /**************************************************************************/ 20 /**************************************************************************/ 21 22 /**************************************************************************/ 23 /* */ 24 /* EKP DEFINITIONS RELEASE */ 25 /* */ 26 /* tx_px_time.h PORTABLE C */ 27 /* 6.1.7 */ 28 /* AUTHOR */ 29 /* */ 30 /* William E. Lamie, Microsoft Corporation */ 31 /* */ 32 /* DESCRIPTION */ 33 /* */ 34 /* This file defines the constants, structures, etc. needed to */ 35 /* implement time related functionality for the Evacuation Kit */ 36 /* for POSIX Users (POSIX) */ 37 /* */ 38 /* */ 39 /* RELEASE HISTORY */ 40 /* */ 41 /* DATE NAME DESCRIPTION */ 42 /* */ 43 /* 06-02-2021 William E. Lamie Initial Version 6.1.7 */ 44 /* */ 45 /**************************************************************************/ 46 47 #ifndef _TX_PX_TIME_H 48 #define _TX_PX_TIME_H 49 50 #ifndef _TIME_T 51 #define _TIME_T 52 typedef ULONG time_t; 53 #endif 54 55 56 struct timespec 57 { 58 ULONG timeout_value; /* time in terms of CPU ticks */ 59 time_t tv_sec; /* time in terms of Seconds */ 60 ULONG tv_nsec; /* time in terms of nano seconds*/ 61 }; 62 63 # define CLOCK_REALTIME 1 64 65 66 INT clock_settime(clockid_t, const struct timespec *); 67 INT clock_gettime(clockid_t, struct timespec *); 68 INT clock_getres(clockid_t, struct timespec *); 69 70 71 INT nanosleep(struct timespec *req, struct timespec *rem); 72 UINT sleep(ULONG seconds); 73 74 #endif 75 76 77