Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
posix_types.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_POSIX_POSIX_TYPES_H_
8#define ZEPHYR_INCLUDE_POSIX_POSIX_TYPES_H_
9
10#if !(defined(CONFIG_NATIVE_LIBC))
11#include <sys/types.h>
12#endif
13
14#if !defined(_CLOCK_T_DECLARED) && !defined(__clock_t_defined)
15typedef unsigned long clock_t;
16#define _CLOCK_T_DECLARED
17#define __clock_t_defined
18#endif
19
20#if !defined(_CLOCKID_T_DECLARED) && !defined(__clockid_t_defined)
21typedef unsigned long clockid_t;
22#define _CLOCKID_T_DECLARED
23#define __clockid_t_defined
24#endif
25
26#ifdef CONFIG_NEWLIB_LIBC
27#include <sys/_pthreadtypes.h>
28#endif
29
30#include <zephyr/kernel.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#if !defined(_DEV_T_DECLARED) && !defined(__dev_t_defined)
37typedef int dev_t;
38#define _DEV_T_DECLARED
39#define __dev_t_defined
40#endif
41
42#if !defined(_INO_T_DECLARED) && !defined(__ino_t_defined)
43typedef int ino_t;
44#define _INO_T_DECLARED
45#define __ino_t_defined
46#endif
47
48#if !defined(_NLINK_T_DECLARED) && !defined(__nlink_t_defined)
49typedef unsigned short nlink_t;
50#define _NLINK_T_DECLARED
51#define __nlink_t_defined
52#endif
53
54#if !defined(_UID_T_DECLARED) && !defined(__uid_t_defined)
55typedef unsigned short uid_t;
56#define _UID_T_DECLARED
57#define __uid_t_defined
58#endif
59
60#if !defined(_GID_T_DECLARED) && !defined(__gid_t_defined)
61typedef unsigned short gid_t;
62#define _GID_T_DECLARED
63#define __gid_t_defined
64#endif
65
66#if !defined(_BLKSIZE_T_DECLARED) && !defined(__blksize_t_defined)
67typedef unsigned long blksize_t;
68#define _BLKSIZE_T_DECLARED
69#define __blksize_t_defined
70#endif
71
72#if !defined(_BLKCNT_T_DECLARED) && !defined(__blkcnt_t_defined)
73typedef unsigned long blkcnt_t;
74#define _BLKCNT_T_DECLARED
75#define __blkcnt_t_defined
76#endif
77
78#if !defined(CONFIG_ARCMWDT_LIBC) && !defined(CONFIG_XTENSA_LIBC)
79typedef int pid_t;
80#endif
81
82#if !defined(_USECONDS_T_DECLARED) && !defined(__useconds_t_defined)
83typedef unsigned long useconds_t;
84#endif
85
86/* time related attributes */
87#if !defined(__timer_t_defined) && !defined(_TIMER_T_DECLARED)
88typedef unsigned long timer_t;
89#endif
90
91/* Thread attributes */
92#if !defined(CONFIG_NEWLIB_LIBC) && !defined(CONFIG_XTENSA_LIBC)
93#if !defined(_PTHREAD_ATTR_T_DECLARED) && !defined(__pthread_attr_t_defined)
94typedef struct {
95 void *stack;
96 unsigned int details[2];
98#define _PTHREAD_ATTR_T_DECLARED
99#define __pthread_attr_t_defined
100#endif
101#endif
102
103#if !defined(CONFIG_XTENSA_LIBC)
105#endif
106
108
109/* Semaphore */
110typedef struct k_sem sem_t;
111
112/* Mutex */
113#if !defined(CONFIG_XTENSA_LIBC)
115#endif
116
117#if !defined(CONFIG_XTENSA_LIBC)
119 unsigned char type: 2;
120 bool initialized: 1;
121};
122#endif
123
124#if !defined(CONFIG_NEWLIB_LIBC) && !defined(CONFIG_XTENSA_LIBC)
126BUILD_ASSERT(sizeof(pthread_mutexattr_t) >= sizeof(struct pthread_mutexattr));
127#endif
128
129/* Condition variables */
130#if !defined(CONFIG_XTENSA_LIBC)
132#endif
133
134#if !defined(CONFIG_XTENSA_LIBC)
138#endif
139
140#if !defined(CONFIG_NEWLIB_LIBC) && !defined(CONFIG_XTENSA_LIBC)
142BUILD_ASSERT(sizeof(pthread_condattr_t) >= sizeof(struct pthread_condattr));
143#endif
144
145/* Barrier */
146#if !defined(CONFIG_XTENSA_LIBC)
148#endif
149
150#if !defined(CONFIG_XTENSA_LIBC)
154#endif
155
156#if !defined(CONFIG_XTENSA_LIBC)
158#endif
159
160#if !defined(CONFIG_XTENSA_LIBC)
162#endif
163
165 bool flag;
166};
167
168#if !defined(CONFIG_NEWLIB_LIBC) && !defined(CONFIG_XTENSA_LIBC)
171/* Newlib typedefs pthread_once_t as a struct with two ints */
172BUILD_ASSERT(sizeof(pthread_once_t) >= sizeof(struct pthread_once));
173#endif
174
175#ifdef __cplusplus
176}
177#endif
178
179#endif /* ZEPHYR_INCLUDE_POSIX_POSIX_TYPES_H_ */
Public kernel APIs.
long pid_t
Definition posix_signal.h:81
unsigned int pthread_t
Definition posix_signal.h:30
int uid_t
Definition posix_signal.h:41
unsigned long clockid_t
Definition posix_time.h:26
unsigned long timer_t
Definition posix_time.h:32
int dev_t
Definition posix_types.h:37
uint32_t pthread_cond_t
Definition posix_types.h:131
unsigned long useconds_t
Definition posix_types.h:83
uint32_t pthread_spinlock_t
Definition posix_types.h:107
struct pthread_mutexattr pthread_mutexattr_t
Definition posix_types.h:125
struct pthread_barrierattr pthread_barrierattr_t
struct pthread_once pthread_once_t
Definition posix_types.h:170
unsigned short gid_t
Definition posix_types.h:61
unsigned long clock_t
Definition posix_types.h:15
uint32_t pthread_mutex_t
Definition posix_types.h:114
uint32_t pthread_rwlockattr_t
Definition posix_types.h:157
unsigned long blksize_t
Definition posix_types.h:67
int ino_t
Definition posix_types.h:43
uint32_t pthread_key_t
Definition posix_types.h:169
unsigned short nlink_t
Definition posix_types.h:49
struct pthread_condattr pthread_condattr_t
Definition posix_types.h:141
unsigned long blkcnt_t
Definition posix_types.h:73
uint32_t pthread_rwlock_t
Definition posix_types.h:161
uint32_t pthread_barrier_t
Definition posix_types.h:147
struct k_sem sem_t
Definition posix_types.h:110
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Semaphore structure.
Definition kernel.h:4002
Definition posix_signal.h:89
Definition posix_types.h:151
int pshared
Definition posix_types.h:152
Definition posix_types.h:135
clockid_t clock
Definition posix_types.h:136
Definition posix_types.h:118
unsigned char type
Definition posix_types.h:119
bool initialized
Definition posix_types.h:120
Definition posix_types.h:164
bool flag
Definition posix_types.h:165