Subversion Repositories Kolibri OS

Rev

Rev 4874 | Rev 6099 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4874 Rev 4921
Line 87... Line 87...
87
#  define	physadr		physadr_t
87
#  define	physadr		physadr_t
88
#  define	quad		quad_t
88
#  define	quad		quad_t
Line 89... Line 89...
89
 
89
 
90
#ifndef _BSDTYPES_DEFINED
90
#ifndef _BSDTYPES_DEFINED
-
 
91
/* also defined in mingw/gmon.h and in w32api/winsock[2].h */
91
/* also defined in mingw/gmon.h and in w32api/winsock[2].h */
92
#ifndef __u_char_defined
-
 
93
typedef	unsigned char	u_char;
-
 
94
#define __u_char_defined
-
 
95
#endif
92
typedef	unsigned char	u_char;
96
#ifndef __u_short_defined
-
 
97
typedef	unsigned short	u_short;
-
 
98
#define __u_short_defined
-
 
99
#endif
93
typedef	unsigned short	u_short;
100
#ifndef __u_int_defined
-
 
101
typedef	unsigned int	u_int;
-
 
102
#define __u_int_defined
-
 
103
#endif
94
typedef	unsigned int	u_int;
104
#ifndef __u_long_defined
-
 
105
typedef	unsigned long	u_long;
-
 
106
#define __u_long_defined
95
typedef	unsigned long	u_long;
107
#endif
96
#define _BSDTYPES_DEFINED
108
#define _BSDTYPES_DEFINED
Line 97... Line 109...
97
#endif
109
#endif
98
 
110
 
Line 107... Line 119...
107
#endif
119
#endif
Line 108... Line 120...
108
 
120
 
109
#ifndef __time_t_defined
121
#ifndef __time_t_defined
110
typedef _TIME_T_ time_t;
122
typedef _TIME_T_ time_t;
-
 
123
#define __time_t_defined
Line -... Line 124...
-
 
124
#endif
-
 
125
 
111
#define __time_t_defined
126
#ifndef __timespec_defined
Line 112... Line 127...
112
 
127
#define __timespec_defined
113
/* Time Value Specification Structures, P1003.1b-1993, p. 261 */
128
/* Time Value Specification Structures, P1003.1b-1993, p. 261 */
114
 
129
 
115
struct timespec {
130
struct timespec {
-
 
131
  time_t  tv_sec;   /* Seconds */
Line 116... Line 132...
116
  time_t  tv_sec;   /* Seconds */
132
  long    tv_nsec;  /* Nanoseconds */
117
  long    tv_nsec;  /* Nanoseconds */
133
};
118
};
134
#endif
119
 
135
 
120
struct itimerspec {
-
 
Line -... Line 136...
-
 
136
struct itimerspec {
121
  struct timespec  it_interval;  /* Timer period */
137
  struct timespec  it_interval;  /* Timer period */
-
 
138
  struct timespec  it_value;     /* Timer expiration */
-
 
139
};
-
 
140
 
122
  struct timespec  it_value;     /* Timer expiration */
141
#ifndef __daddr_t_defined
-
 
142
typedef	long	daddr_t;
-
 
143
#define __daddr_t_defined
Line 123... Line 144...
123
};
144
#endif
124
#endif
145
#ifndef __caddr_t_defined
125
 
146
typedef	char *	caddr_t;
126
typedef	long	daddr_t;
147
#define __caddr_t_defined
Line 205... Line 226...
205
   by __USE_W32_SOCKETS) the W32api winsock[2].h header which
226
   by __USE_W32_SOCKETS) the W32api winsock[2].h header which
206
   defines Windows versions of them.   Note that a program which
227
   defines Windows versions of them.   Note that a program which
207
   includes the W32api winsock[2].h header must know what it is doing;
228
   includes the W32api winsock[2].h header must know what it is doing;
208
   it must not call the cygwin32 select function.
229
   it must not call the cygwin32 select function.
209
*/
230
*/
210
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) 
231
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) 
211
#  define _SYS_TYPES_FD_SET
232
#  define _SYS_TYPES_FD_SET
212
#  define	NBBY	8		/* number of bits in a byte */
233
#  define	NBBY	8		/* number of bits in a byte */
213
/*
234
/*
214
 * Select uses bit masks of file descriptors in longs.
235
 * Select uses bit masks of file descriptors in longs.
215
 * These macros manipulate such bit fields (the filesystem macros use chars).
236
 * These macros manipulate such bit fields (the filesystem macros use chars).
Line 242... Line 263...
242
     char *__tmp = (char *)p; \
263
     char *__tmp = (char *)p; \
243
     for (__i = 0; __i < sizeof (*(p)); ++__i) \
264
     for (__i = 0; __i < sizeof (*(p)); ++__i) \
244
       *__tmp++ = 0; \
265
       *__tmp++ = 0; \
245
}))
266
}))
Line 246... Line 267...
246
 
267
 
Line 247... Line 268...
247
# endif	/* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS)) */
268
# endif	/* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) */
248
 
269
 
Line 299... Line 320...
299
 
320
 
300
/* P1003.1c/D10, p. 141 */
321
/* P1003.1c/D10, p. 141 */
301
#define PTHREAD_CREATE_DETACHED 0
322
#define PTHREAD_CREATE_DETACHED 0
Line 302... Line 323...
302
#define PTHREAD_CREATE_JOINABLE  1
323
#define PTHREAD_CREATE_JOINABLE  1
303
 
-
 
304
#if defined(__XMK__) || defined(__rtems__)
-
 
305
/* The following defines are part of the X/Open System Interface (XSI). */
-
 
306
 
-
 
307
/* This type of mutex does not detect deadlock. A thread attempting to relock this mutex without first unlocking 
-
 
308
 * it shall deadlock. Attempting to unlock a mutex locked by a different thread results in undefined behavior. 
-
 
309
 * Attempting to unlock an unlocked mutex results in undefined behavior. 
-
 
310
 */
-
 
311
#define PTHREAD_MUTEX_NORMAL  1
-
 
312
 
-
 
313
/* 
-
 
314
 * This type of mutex provides error checking. A thread attempting to relock this mutex without first unlocking 
-
 
315
 * it shall return with an error. A thread attempting to unlock a mutex which another thread has locked shall return 
-
 
316
 * with an error. A thread attempting to unlock an unlocked mutex shall return with an error. 
-
 
317
 */
-
 
318
#define PTHREAD_MUTEX_ERRORCHECK  2 
-
 
319
 
-
 
320
/* A thread attempting to relock this mutex without first unlocking it shall succeed in locking the mutex. 
-
 
321
 * The relocking deadlock which can occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex. 
-
 
322
 * Multiple locks of this mutex shall require the same number of unlocks to release the mutex before another thread can 
-
 
323
 * acquire the mutex. A thread attempting to unlock a mutex which another thread has locked shall return with an error. 
-
 
324
 * A thread attempting to unlock an unlocked mutex shall return with an error. 
-
 
325
 */
-
 
326
#define PTHREAD_MUTEX_RECURSIVE  3
-
 
327
 
-
 
328
/* Attempting to recursively lock a mutex of this type results in undefined behavior. Attempting to unlock a 
-
 
329
 * mutex of this type which was not locked by the calling thread results in undefined behavior. Attempting to 
324
 
330
 * unlock a mutex of this type which is not locked results in undefined behavior. An implementation may map this 
325
#if defined(__rtems__)
331
 * mutex to one of the other mutex types.
-
 
332
 */
-
 
333
#define PTHREAD_MUTEX_DEFAULT  4 
-
 
Line 334... Line 326...
334
 
326
  #include 
335
#endif /* defined(__XMK__) || defined(__rtems__) */
327
#endif
336
 
328
 
337
#if defined(__XMK__)
329
#if defined(__XMK__)
Line 361... Line 353...
361
  /* P1003.4b/D8, p. 54 adds cputime_clock_allowed attribute.  */
353
  /* P1003.4b/D8, p. 54 adds cputime_clock_allowed attribute.  */
362
#if defined(_POSIX_THREAD_CPUTIME)
354
#if defined(_POSIX_THREAD_CPUTIME)
363
  int  cputime_clock_allowed;  /* see time.h */
355
  int  cputime_clock_allowed;  /* see time.h */
364
#endif
356
#endif
365
  int  detachstate;
357
  int  detachstate;
-
 
358
#if defined(__rtems__)
-
 
359
  size_t affinitysetsize;
-
 
360
  cpu_set_t *affinityset;
-
 
361
  cpu_set_t affinitysetpreallocated;
366
 
362
#endif
367
} pthread_attr_t;
363
} pthread_attr_t;
Line 368... Line 364...
368
 
364
 
Line 369... Line 365...
369
#endif /* !defined(__XMK__) */
365
#endif /* !defined(__XMK__) */
Line 389... Line 385...
389
 
385
 
Line 390... Line 386...
390
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
386
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
Line -... Line 387...
-
 
387
 
-
 
388
/* Values for mutex type */
-
 
389
 
-
 
390
/* The following defines are part of the X/Open System Interface (XSI). */
-
 
391
 
-
 
392
/*
-
 
393
 * This type of mutex does not detect deadlock. A thread attempting to
-
 
394
 * relock this mutex without first unlocking it shall deadlock. Attempting
-
 
395
 * to unlock a mutex locked by a different thread results in undefined
391
 
396
 * behavior.  Attempting to unlock an unlocked mutex results in undefined
-
 
397
 * behavior.
-
 
398
 */
-
 
399
#define PTHREAD_MUTEX_NORMAL     0
-
 
400
 
-
 
401
/*
-
 
402
 * A thread attempting to relock this mutex without first unlocking
-
 
403
 * it shall succeed in locking the mutex.  The relocking deadlock which
-
 
404
 * can occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with
-
 
405
 * this type of mutex.  Multiple locks of this mutex shall require the
-
 
406
 * same number of unlocks to release the mutex before another thread can
-
 
407
 * acquire the mutex. A thread attempting to unlock a mutex which another
392
/* Values for mutex type */
408
 * thread has locked shall return with an error.  A thread attempting to
-
 
409
 * unlock an unlocked mutex shall return with an error.
-
 
410
 */
-
 
411
#define PTHREAD_MUTEX_RECURSIVE  1
-
 
412
 
-
 
413
/* 
-
 
414
 * This type of mutex provides error checking. A thread attempting
-
 
415
 * to relock this mutex without first unlocking it shall return with an
-
 
416
 * error. A thread attempting to unlock a mutex which another thread has
393
 
417
 * locked shall return with an error. A thread attempting to unlock an
-
 
418
 * unlocked mutex shall return with an error.
-
 
419
 */
-
 
420
#define PTHREAD_MUTEX_ERRORCHECK 2
-
 
421
 
-
 
422
/*
-
 
423
 * Attempting to recursively lock a mutex of this type results
-
 
424
 * in undefined behavior. Attempting to unlock a mutex of this type
-
 
425
 * which was not locked by the calling thread results in undefined
-
 
426
 * behavior. Attempting to unlock a mutex of this type which is not locked
394
#define PTHREAD_MUTEX_NORMAL     0
427
 * results in undefined behavior. An implementation may map this mutex to
Line 395... Line 428...
395
#define PTHREAD_MUTEX_RECURSIVE  1
428
 * one of the other mutex types.
Line 396... Line 429...
396
#define PTHREAD_MUTEX_ERRORCHECK 2
429
 */
397
#define PTHREAD_MUTEX_DEFAULT    3
430
#define PTHREAD_MUTEX_DEFAULT    3
Line 398... Line 431...
398
 
431
 
Line 461... Line 494...
461
} pthread_barrierattr_t;
494
} pthread_barrierattr_t;
462
#endif /* defined(_POSIX_BARRIERS) */
495
#endif /* defined(_POSIX_BARRIERS) */
Line 463... Line 496...
463
 
496
 
Line -... Line 497...
-
 
497
/* POSIX Spin Lock Types */
464
/* POSIX Spin Lock Types */
498
 
465
 
499
#if !defined (__CYGWIN__)
466
#if defined(_POSIX_SPIN_LOCKS)
500
#if defined(_POSIX_SPIN_LOCKS)
Line 467... Line 501...
467
typedef __uint32_t pthread_spinlock_t;        /* POSIX Spin Lock Object */
501
typedef __uint32_t pthread_spinlock_t;        /* POSIX Spin Lock Object */
Line 468... Line -...
468
#endif /* defined(_POSIX_SPIN_LOCKS) */
-
 
469
 
502
#endif /* defined(_POSIX_SPIN_LOCKS) */
470
/* POSIX Reader/Writer Lock Types */
503
 
471
 
504
/* POSIX Reader/Writer Lock Types */
472
#if !defined (__CYGWIN__)
505
 
473
#if defined(_POSIX_READER_WRITER_LOCKS)
506
#if defined(_POSIX_READER_WRITER_LOCKS)