1 #include "tkshlib.h" 2 #include <dirent.h> 3 #include <pwd.h> 4 #include <times.h> 5 #if HAVE_TIME_H && !_PACKAGE_ast 6 #include <time.h> 7 #endif 8 #include <sys/stat.h> 9 #if HAVE_SYS_PARAM_H 10 #include <sys/param.h> 11 #endif 12 #if HAVE___FD_MASK 13 #define fd_mask __fd_mask 14 #endif 15 16 #ifndef S_ISLNK 17 #define S_ISLNK(m) 0 18 #endif 19 #ifndef S_ISSOCK 20 #define S_ISSOCK(m) 0 21 #endif 22 23 #ifndef MAXPATHLEN 24 # ifdef PATH_MAX 25 # define MAXPATHLEN PATH_MAX 26 # else 27 # define MAXPATHLEN 2048 28 # endif 29 #endif 30 31 #ifndef NBBY 32 # define NBBY (CHAR_BIT*sizeof(fd_mask)) 33 #endif 34 #ifndef howmany 35 # define howmany(x, y) (((x)+((y)-1))/(y)) 36 #endif 37 #ifndef MASK_SIZE 38 # define MASK_SIZE howmany(FD_SETSIZE, NFDBITS) 39 #endif 40 #ifndef SELECT_MASK 41 # define SELECT_MASK fd_set 42 #endif 43 44 45 /* this should be done by iffe */ 46 #if sun 47 #define HAVE_GETTIMEOFDAY 48 #else 49 #define HAVE_TIMEZONE_VAR 50 #endif 51 52 #define TclpGetDate(t,u) ((u) ? gmtime((t)) : localtime((t))) 53 #define TclStrftime(s,m,f,t) (strftime((s),(m),(f),(t))) 54