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