summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixPort.h
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-06-23 00:24:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-06-23 00:24:31 (GMT)
commit32d847fdb1dab403a2db715367cceadad9f9e467 (patch)
tree5a154848a1901797f909f029933e19ccdb283c63 /unix/tclUnixPort.h
parent02be87df7fbd313cca35b5461372f13152ac7131 (diff)
downloadtcl-32d847fdb1dab403a2db715367cceadad9f9e467.zip
tcl-32d847fdb1dab403a2db715367cceadad9f9e467.tar.gz
tcl-32d847fdb1dab403a2db715367cceadad9f9e467.tar.bz2
Version of [Patch 746578] that works with Linux and is likely to work elsewhere
Diffstat (limited to 'unix/tclUnixPort.h')
-rw-r--r--unix/tclUnixPort.h37
1 files changed, 24 insertions, 13 deletions
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 4000de6..93a9285 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -19,7 +19,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixPort.h,v 1.37 2004/05/27 13:18:55 dkf Exp $
+ * RCS: @(#) $Id: tclUnixPort.h,v 1.38 2004/06/23 00:24:42 dkf Exp $
*/
#ifndef _TCLUNIXPORT
@@ -553,7 +553,7 @@ typedef int socklen_t;
*/
#ifdef TCL_THREADS
-#include <pthread.h>
+# include <pthread.h>
typedef pthread_mutex_t TclpMutex;
EXTERN void TclpMutexInit _ANSI_ARGS_((TclpMutex *mPtr));
EXTERN void TclpMutexLock _ANSI_ARGS_((TclpMutex *mPtr));
@@ -562,25 +562,36 @@ EXTERN Tcl_DirEntry * TclpReaddir(DIR *);
EXTERN struct tm * TclpLocaltime(CONST time_t *);
EXTERN struct tm * TclpGmtime(CONST time_t *);
EXTERN char * TclpInetNtoa(struct in_addr);
-#define readdir(x) TclpReaddir(x)
+# define readdir(x) TclpReaddir(x)
/* #define localtime(x) TclpLocaltime(x)
* #define gmtime(x) TclpGmtime(x) */
-#undef inet_ntoa
-#define inet_ntoa(x) TclpInetNtoa(x)
-#undef TclOSreaddir
-#define TclOSreaddir(x) TclpReaddir(x)
-#ifdef MAC_OSX_TCL
+# undef inet_ntoa
+# define inet_ntoa(x) TclpInetNtoa(x)
+# undef TclOSreaddir
+# define TclOSreaddir(x) TclpReaddir(x)
+# ifdef MAC_OSX_TCL
/*
* On Mac OS X, realpath is currently not
* thread safe, c.f. SF bug # 711232.
*/
-#define NO_REALPATH
-#endif
+# define NO_REALPATH
+# endif
+# ifdef HAVE_PTHREAD_ATTR_GET_NP
+# include <pthread_np.h>
+# define TclpPthreadGetAttrs pthread_attr_get_np
+# else
+# ifdef HAVE_PTHREAD_GETATTR_NP
+# define TclpPthreadGetAttrs pthread_getattr_np
+# ifdef GETATTRNP_NOT_DECLARED
+EXTERN int pthread_getattr_np _ANSI_ARGS_((pthread_t, pthread_attr_t *));
+# endif
+# endif /* HAVE_PTHREAD_GETATTR_NP */
+# endif /* HAVE_PTHREAD_ATTR_GET_NP */
#else
typedef int TclpMutex;
-#define TclpMutexInit(a)
-#define TclpMutexLock(a)
-#define TclpMutexUnlock(a)
+# define TclpMutexInit(a)
+# define TclpMutexLock(a)
+# define TclpMutexUnlock(a)
#endif /* TCL_THREADS */
#endif /* _TCLUNIXPORT */