lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /**************************************************************************
|
| 2 | *
|
| 3 | * Copyright (c) 2012 ZTE Corporation.
|
| 4 | *
|
| 5 | ***************************************************************************
|
| 6 | * Ä£ ¿é Ãû : P98C_OSS
|
| 7 | * ÎÄ ¼þ Ãû : oss_posix.h
|
| 8 | * Ïà¹ØÎļþ :
|
| 9 | * ʵÏÖ¹¦ÄÜ : posix¿âÍ·Îļþ
|
| 10 | * ×÷ Õß : chenxingfang
|
| 11 | * °æ ±¾ : V1.0
|
| 12 | * Íê³ÉÈÕÆÚ : 2012-08-10
|
| 13 | * ÆäËü˵Ã÷ :
|
| 14 | **************************************************************************/
|
| 15 |
|
| 16 | /**************************************************************************
|
| 17 | * Ð޸ļǼ
|
| 18 | **************************************************************************/
|
| 19 | #ifndef _OSS_POSIX_H
|
| 20 | #define _OSS_POSIX_H
|
| 21 |
|
| 22 | #define _USE_POSIX
|
| 23 | #ifdef _USE_POSIX
|
| 24 |
|
| 25 | /**************************************************************************
|
| 26 | * #includeÇø
|
| 27 | **************************************************************************/
|
| 28 | #ifdef _OS_TOS
|
| 29 | #include <sys/time.h>
|
| 30 | #include <sys/types.h>
|
| 31 | #elif defined (_OS_LINUX)
|
| 32 |
|
| 33 | #else
|
| 34 | #include "sys/types.h"
|
| 35 | #endif
|
| 36 |
|
| 37 | #ifdef __cplusplus
|
| 38 | extern "C"
|
| 39 | {
|
| 40 | #endif
|
| 41 |
|
| 42 | /**************************************************************************
|
| 43 | * ³£Á¿¶¨ÒåÇø
|
| 44 | **************************************************************************/
|
| 45 |
|
| 46 | /**************************************************************************
|
| 47 | * Êý¾Ý½á¹¹¶¨ÒåÇø
|
| 48 | **************************************************************************/
|
| 49 | /* ʱ¼ä¶¨Òå */
|
| 50 | #ifndef _OS_WIN
|
| 51 | typedef struct timeval ZOSS_S_TIMEVAL;
|
| 52 | typedef struct timezone ZOSS_S_TIMEZONE;
|
| 53 | typedef struct timespec ZOSS_S_TIMESPEC;
|
| 54 | #else
|
| 55 | # ifndef _USE_OS_SOCK
|
| 56 | typedef struct timeval
|
| 57 | # else
|
| 58 | typedef struct
|
| 59 | # endif
|
| 60 | {
|
| 61 | SINT32 tv_sec;
|
| 62 | SINT32 tv_usec;
|
| 63 | }ZOSS_S_TIMEVAL;
|
| 64 |
|
| 65 | typedef struct timezone
|
| 66 | {
|
| 67 | SINT32 tz_minuteswest; /* minutes west of Greenwich,ºÍGreenwich ʱ¼ä²îÁ˶àÉÙ·ÖÖÓ */
|
| 68 | SINT32 tz_dsttime; /* type of dst correction to apply ,ÈÕ¹â½ÚԼʱ¼äµÄ״̬Ëù´ú±íµÄ״̬ÈçÏÂ
|
| 69 | DST_NONE ²»Ê¹ÓÃ
|
| 70 | DST_USA ÃÀ¹ú
|
| 71 | DST_AUST °ÄÖÞ
|
| 72 | DST_WET Î÷Å·
|
| 73 | DST_MET ÖÐÅ·
|
| 74 | DST_EET ¶«Å·
|
| 75 | DST_CAN ¼ÓÄôó
|
| 76 | DST_GB ´ó²»Áеß
|
| 77 | DST_RUM ÂÞÂíÄáÑÇ
|
| 78 | DST_TUR ÍÁ¶úÆä
|
| 79 | DST_AUSTALT °ÄÖÞ(1986ÄêÒÔºó) */
|
| 80 | }ZOSS_S_TIMEZONE;
|
| 81 |
|
| 82 | typedef struct timespec
|
| 83 | {
|
| 84 | SINT32 tv_sec;
|
| 85 | SINT32 tv_nsec;
|
| 86 | }ZOSS_S_TIMESPEC;
|
| 87 | #endif
|
| 88 |
|
| 89 | /**************************************************************************
|
| 90 | * º¯ÊýÉùÃ÷Çø
|
| 91 | **************************************************************************/
|
| 92 | UINT32 zOss_Gettimeofday(ZOSS_S_TIMEVAL *tv, ZOSS_S_TIMEZONE *tz);
|
| 93 | UINT32 zOss_Settimeofday(ZOSS_S_TIMEVAL *tv, ZOSS_S_TIMEZONE *tz);
|
| 94 |
|
| 95 | /**************************************************************************
|
| 96 | * È«¾Ö±äÁ¿ÉùÃ÷Çø
|
| 97 | **************************************************************************/
|
| 98 |
|
| 99 | #ifdef __cplusplus
|
| 100 | }
|
| 101 | #endif
|
| 102 |
|
| 103 | #endif /* _USE_POSIX */
|
| 104 |
|
| 105 | #endif /* _OSS_POSIX_H */
|
| 106 |
|