/* ** NGPT - Next Generation POSIX Threading ** Copyright (c) 2001 IBM Corporation ** Portions Copyright (c) 1999-2000 Ralf S. Engelschall ** ** This file is part of NGPT, a non-preemptive thread scheduling ** library which can be found at http://www.ibm.com/developer. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** You should have received a copy of the GNU Lesser General Public ** License along with this library; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 ** USA. ** ** pth_p.h: Pth private API definitions */ #ifndef _PTH_P_H_ #define _PTH_P_H_ /* System 390 Linux doesn't define __clone or __clone2 */ #ifdef __s390__ #define clone __clone #define clone2 __clone2 #endif /* mandatory system headers */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* library version */ #define _PTH_VERS_C_AS_HEADER_ #include "pth_vers.c" #undef _PTH_VERS_C_AS_HEADER_ /* public API headers */ #define _PTH_PRIVATE #include "pth.h" #undef _PTH_PRIVATE /* autoconf defines and macros */ #include "pth_acdef.h" #include "pth_acmac.h" /* optional system headers */ #ifdef HAVE_SYS_RESOURCE_H #include #endif #ifdef HAVE_NET_ERRNO_H #include #endif /* dmalloc support */ #ifdef PTH_DMALLOC #include #endif /* non-blocking flags */ #ifdef O_NONBLOCK #define O_NONBLOCKING O_NONBLOCK #else #ifdef O_NDELAY #define O_NONBLOCKING O_NDELAY #else #ifdef FNDELAY #define O_NONBLOCKING FNDELAY #else #error "No O_NONBLOCK, O_NDELAY or FNDELAY flag available!" #endif #endif #endif #ifndef PTH_HAVE_KERNEL_PATCH #define gettid getpid #define tkill kill #endif #define pth_assert(c) \ if (!(c)) { \ fprintf(stderr, "%d.%d:%s,%04d: Assert failed.\n", (int)getpid(), (int)gettid(), __FILE__, __LINE__); \ abort(); \ } #define pth_lock_all() \ { pth_acquire_lock(&(pth_NQ.q_lock)); \ pth_acquire_lock(&(pth_RQ.q_lock)); \ pth_acquire_lock(&(pth_WQ.q_lock)); \ pth_acquire_lock(&(pth_SQ.q_lock)); \ pth_acquire_lock(&(pth_DQ.q_lock)); \ } #define pth_release_all() \ { pth_release_lock(&(pth_NQ.q_lock)); \ pth_release_lock(&(pth_RQ.q_lock)); \ pth_release_lock(&(pth_WQ.q_lock)); \ pth_release_lock(&(pth_SQ.q_lock)); \ pth_release_lock(&(pth_DQ.q_lock)); \ } #define strong_alias(orig, alias) \ asm(".globl " #alias "\n\t.set " #alias "," #orig); #define versioned_symbol(real, name, version) \ __asm__(".symver " #real "," #name "@@" #version); /* compiler happyness: avoid ``empty compilation unit'' problem */ #define COMPILER_HAPPYNESS(name) \ int __##name##_unit = 0; /* generated contents */ BEGIN_DECLARATION ==#== END_DECLARATION #endif /* _PTH_P_H_ */