1/* 2** GNU Pth - The GNU Portable Threads 3** Copyright (c) 1999-2006 Ralf S. Engelschall <rse@engelschall.com> 4** 5** This file is part of GNU Pth, a non-preemptive thread scheduling 6** library which can be found at http://www.gnu.org/software/pth/. 7** 8** This library is free software; you can redistribute it and/or 9** modify it under the terms of the GNU Lesser General Public 10** License as published by the Free Software Foundation; either 11** version 2.1 of the License, or (at your option) any later version. 12** 13** This library is distributed in the hope that it will be useful, 14** but WITHOUT ANY WARRANTY; without even the implied warranty of 15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16** Lesser General Public License for more details. 17** 18** You should have received a copy of the GNU Lesser General Public 19** License along with this library; if not, write to the Free Software 20** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21** USA, or contact Ralf S. Engelschall <rse@engelschall.com>. 22** 23** pth_p.h: Pth private API definitions 24*/ 25 26#ifndef _PTH_P_H_ 27#define _PTH_P_H_ 28 29/* mandatory system headers */ 30#include <stdio.h> 31#include <stdlib.h> 32#include <stdarg.h> 33#include <string.h> 34#include <setjmp.h> 35#ifdef __FreeBSD__ 36# include <osreldate.h> 37# if __FreeBSD_version < 800070 38 /* See http://www.freebsd.org/cgi/query-pr.cgi?pr=132828 */ 39# include <signal.h> 40# endif /* __FreeBSD_version */ 41#else /* __FreeBSD__ */ 42# include <signal.h> 43#endif /* __FreeBSD__ */ 44#include <unistd.h> 45#include <fcntl.h> 46#include <errno.h> 47#include <ctype.h> 48#include <sys/types.h> 49#include <sys/time.h> 50#include <sys/wait.h> 51#include <sys/stat.h> 52#include <sys/socket.h> 53#include <time.h> 54 55/* library version */ 56#define _PTH_VERS_C_AS_HEADER_ 57#include "pth_vers.c" 58#undef _PTH_VERS_C_AS_HEADER_ 59 60/* public API headers */ 61#define _PTH_PRIVATE 62#include "pth.h" 63#undef _PTH_PRIVATE 64 65/* autoconf defines and macros */ 66#include "pth_acdef.h" 67#include "pth_acmac.h" 68 69/* optional system headers */ 70#ifdef HAVE_SYS_RESOURCE_H 71#include <sys/resource.h> 72#endif 73#ifdef HAVE_NET_ERRNO_H 74#include <net/errno.h> 75#endif 76#ifdef HAVE_DLFCN_H 77#include <dlfcn.h> 78#endif 79 80/* dmalloc support */ 81#ifdef PTH_DMALLOC 82#include <dmalloc.h> 83#endif 84 85/* OSSP ex support */ 86#ifdef PTH_EX 87#define __EX_NS_USE_CUSTOM__ 88#include "ex.h" 89#endif 90 91/* paths */ 92#ifdef HAVE_PATHS_H 93#include <paths.h> 94#endif 95#ifdef _PATH_BSHELL 96#define PTH_PATH_BINSH _PATH_BSHELL 97#else 98#define PTH_PATH_BINSH "/bin/sh" 99#endif 100 101/* non-blocking flags */ 102#ifdef O_NONBLOCK 103#define O_NONBLOCKING O_NONBLOCK 104#else 105#ifdef O_NDELAY 106#define O_NONBLOCKING O_NDELAY 107#else 108#ifdef FNDELAY 109#define O_NONBLOCKING FNDELAY 110#else 111#error "No O_NONBLOCK, O_NDELAY or FNDELAY flag available!" 112#endif 113#endif 114#endif 115 116/* fallback definition for fdset_t size */ 117#if !defined(FD_SETSIZE) 118#define FD_SETSIZE 1024 119#endif 120 121/* fallback definition for struct timespec */ 122#ifndef HAVE_STRUCT_TIMESPEC 123struct timespec { 124 time_t tv_sec; /* seconds */ 125 long tv_nsec; /* and nanoseconds */ 126}; 127#endif 128 129/* compiler happyness: avoid ``empty compilation unit'' problem */ 130#define COMPILER_HAPPYNESS(name) \ 131 int __##name##_unit = 0; 132 133/* generated contents */ 134BEGIN_DECLARATION 135==#== 136END_DECLARATION 137 138#endif /* _PTH_P_H_ */ 139 140