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 typedef INT clockid_t;
56 
57 struct timespec
58 {
59     time_t    tv_sec;                /* time in terms of seconds */
60     ULONG     tv_nsec;               /* remaining time in terms of nano seconds*/
61 } ;
62 
63 struct itimerspec
64 {
65     struct timespec  it_interval ;         /* Timer period. */
66     struct timespec  it_value;             /* Timer expiration. */
67 };
68 
69 #define CLOCK_REALTIME  1
70 #define TIMER_ABSTIME   1
71 #define CLOCK_MONOTONIC 2
72 
73 INT clock_settime(clockid_t, const struct timespec *);
74 INT clock_gettime(clockid_t, struct timespec *);
75 INT clock_getres(clockid_t, struct timespec *);
76 
77 
78 INT nanosleep(struct timespec *req, struct timespec *rem);
79 UINT sleep(ULONG seconds);
80 
81 #endif
82 
83 
84