Changeset 740 for vendor/current/lib/replace
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/lib/replace
- Files:
-
- 9 added
- 1 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/replace/README
r414 r740 34 34 telldir 35 35 seekdir 36 clock_gettime 36 37 closedir 37 38 dlopen … … 76 77 bool 77 78 socklen_t 78 uint_t79 79 uint{8,16,32,64}_t 80 80 int{8,16,32,64}_t -
vendor/current/lib/replace/autoconf-2.60.m4
r414 r740 182 182 m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[ 183 183 AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], 184 [ 185 AC_BEFORE([$0], [AC_COMPILE_IFELSE]) 186 AC_BEFORE([$0], [AC_RUN_IFELSE]) 187 188 AC_REQUIRE([AC_GNU_SOURCE]) 189 AC_REQUIRE([AC_AIX]) 190 AC_REQUIRE([AC_MINIX]) 184 [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl 185 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl 186 187 AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) 188 if test "$MINIX" = yes; then 189 AC_DEFINE([_POSIX_SOURCE], [1], 190 [Define to 1 if you need to in order for `stat' and other 191 things to work.]) 192 AC_DEFINE([_POSIX_1_SOURCE], [2], 193 [Define to 2 if the system does not provide POSIX.1 features 194 except with this defined.]) 195 AC_DEFINE([_MINIX], [1], 196 [Define to 1 if on MINIX.]) 197 fi 191 198 192 199 AH_VERBATIM([__EXTENSIONS__], 193 [/* Enable extensions on Solaris. */ 200 [/* Enable extensions on AIX 3, Interix. */ 201 #ifndef _ALL_SOURCE 202 # undef _ALL_SOURCE 203 #endif 204 /* Enable GNU extensions on systems that have them. */ 205 #ifndef _GNU_SOURCE 206 # undef _GNU_SOURCE 207 #endif 208 /* Enable threading extensions on Solaris. */ 209 #ifndef _POSIX_PTHREAD_SEMANTICS 210 # undef _POSIX_PTHREAD_SEMANTICS 211 #endif 212 /* Enable extensions on HP NonStop. */ 213 #ifndef _TANDEM_SOURCE 214 # undef _TANDEM_SOURCE 215 #endif 216 /* Enable general extensions on Solaris. */ 194 217 #ifndef __EXTENSIONS__ 195 218 # undef __EXTENSIONS__ 196 219 #endif 197 #ifndef _POSIX_PTHREAD_SEMANTICS 198 # undef _POSIX_PTHREAD_SEMANTICS 199 #endif]) 220 ]) 200 221 AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], 201 222 [ac_cv_safe_to_define___extensions__], 202 223 [AC_COMPILE_IFELSE( 203 [AC_LANG_PROGRAM([ 224 [AC_LANG_PROGRAM([[ 204 225 # define __EXTENSIONS__ 1 205 AC_INCLUDES_DEFAULT])],226 ]AC_INCLUDES_DEFAULT])], 206 227 [ac_cv_safe_to_define___extensions__=yes], 207 228 [ac_cv_safe_to_define___extensions__=no])]) 208 229 test $ac_cv_safe_to_define___extensions__ = yes && 209 230 AC_DEFINE([__EXTENSIONS__]) 231 AC_DEFINE([_ALL_SOURCE]) 232 AC_DEFINE([_GNU_SOURCE]) 210 233 AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) 211 ]) 212 ]) 234 AC_DEFINE([_TANDEM_SOURCE]) 235 ])# AC_USE_SYSTEM_EXTENSIONS 236 ]) -
vendor/current/lib/replace/crypt.c
r414 r740 47 47 48 48 #ifndef long32 49 #define long32 int32 49 #define long32 int32_t 50 50 #endif 51 51 52 52 #ifndef long64 53 #define long64 int64 53 #define long64 int64_t 54 54 #endif 55 55 … … 666 666 */ 667 667 clearmem(ktab, sizeof ktab); 668 StrnCpy(ktab, key, 8);668 strncpy(ktab, key, 8); 669 669 ufc_mk_keytab(ktab); 670 670 -
vendor/current/lib/replace/getifaddrs.c
r414 r740 283 283 284 284 while (i > 0) { 285 u int_t inc;285 unsigned int inc; 286 286 287 287 inc = ifr->ifr_addr.sa_len; -
vendor/current/lib/replace/getpass.c
r414 r740 35 35 #endif 36 36 37 #ifndef SIGNAL_CAST38 #define SIGNAL_CAST (RETSIGTYPE (*)(int))39 #endif40 41 37 #ifdef SYSV_TERMIO 42 38 … … 100 96 #endif /* SYSV_TERMIO */ 101 97 102 static void catch_signal(int signum, void (*handler)(int ))98 static void catch_signal(int signum, void (*handler)(int )) 103 99 { 104 100 #ifdef HAVE_SIGACTION … … 132 128 ****************************************************************/ 133 129 134 static void gotintr_sig( void)130 static void gotintr_sig(int signum) 135 131 { 136 132 gotintr = 1; … … 149 145 150 146 /* Catch problematic signals */ 151 catch_signal(SIGINT, SIGNAL_CASTgotintr_sig);147 catch_signal(SIGINT, gotintr_sig); 152 148 153 149 /* Try to write to and read from the terminal if we can. … … 212 208 213 209 /* Catch problematic signals */ 214 catch_signal(SIGINT, SIG NAL_CAST SIG_DFL);210 catch_signal(SIGINT, SIG_DFL); 215 211 216 212 if (gotintr) { 217 printf("Inter upted by signal.\n");213 printf("Interrupted by signal.\n"); 218 214 fflush(stdout); 219 215 exit(1); -
vendor/current/lib/replace/libreplace.m4
r414 r740 52 52 LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o" 53 53 54 AC_TYPE_SIGNAL55 54 AC_TYPE_UID_T 56 55 AC_TYPE_MODE_T … … 91 90 ) 92 91 92 AC_CHECK_HEADERS(linux/types.h) 93 93 94 AC_CACHE_CHECK([for working mmap],libreplace_cv_HAVE_MMAP,[ 94 95 AC_TRY_RUN([#include "$libreplacedir/test/shared_mmap.c"], … … 106 107 AC_CHECK_HEADERS(unix.h) 107 108 108 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror )109 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror strerror_r) 109 110 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename) 110 111 AC_CHECK_FUNCS(waitpid wait4 strlcpy strlcat initgroups memmove strdup) 111 AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2 )112 AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2 dprintf vdprintf) 112 113 AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath) 114 AC_CHECK_FUNCS(fdatasync,,[ 115 # if we didn't find it, look in librt (Solaris hides it there...) 116 AC_CHECK_LIB(rt, fdatasync, 117 [libreplace_cv_HAVE_FDATASYNC_IN_LIBRT=yes 118 AC_DEFINE(HAVE_FDATASYNC, 1, Define to 1 if there is support for fdatasync)]) 119 ]) 120 AC_HAVE_DECL(fdatasync, [#include <unistd.h>]) 121 AC_CHECK_FUNCS(clock_gettime,libreplace_cv_have_clock_gettime=yes,[ 122 AC_CHECK_LIB(rt, clock_gettime, 123 [libreplace_cv_HAVE_CLOCK_GETTIME_IN_LIBRT=yes 124 libreplace_cv_have_clock_gettime=yes 125 AC_DEFINE(HAVE_CLOCK_GETTIME, 1, Define to 1 if there is support for clock_gettime)]) 126 ]) 127 AC_CHECK_FUNCS(get_current_dir_name) 113 128 AC_HAVE_DECL(setresuid, [#include <unistd.h>]) 114 129 AC_HAVE_DECL(setresgid, [#include <unistd.h>]) … … 229 244 AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq) 230 245 246 AC_CHECK_FUNCS(memmem) 247 231 248 # this test disabled as we don't actually need __VA_ARGS__ yet 232 249 AC_TRY_CPP([ … … 281 298 m4_include(crypt.m4) 282 299 300 if test x$libreplace_cv_have_clock_gettime = xyes ; then 301 SMB_CHECK_CLOCK_ID(CLOCK_MONOTONIC) 302 SMB_CHECK_CLOCK_ID(CLOCK_PROCESS_CPUTIME_ID) 303 SMB_CHECK_CLOCK_ID(CLOCK_REALTIME) 304 fi 305 306 AC_CACHE_CHECK([for struct timespec type],libreplace_cv_struct_timespec, [ 307 AC_TRY_COMPILE([ 308 #include <sys/types.h> 309 #if STDC_HEADERS 310 #include <stdlib.h> 311 #include <stddef.h> 312 #endif 313 #if TIME_WITH_SYS_TIME 314 # include <sys/time.h> 315 # include <time.h> 316 #else 317 # if HAVE_SYS_TIME_H 318 # include <sys/time.h> 319 # else 320 # include <time.h> 321 # endif 322 #endif 323 ],[struct timespec ts;], 324 libreplace_cv_struct_timespec=yes,libreplace_cv_struct_timespec=no)]) 325 if test x"$libreplace_cv_struct_timespec" = x"yes"; then 326 AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec]) 327 fi 328 283 329 AC_CHECK_FUNCS([printf memset memcpy],,[AC_MSG_ERROR([Required function not found])]) 284 330 … … 309 355 m4_include(libreplace_macros.m4) 310 356 357 358 dnl SMB_CHECK_CLOCK_ID(clockid) 359 dnl Test whether the specified clock_gettime clock ID is available. If it 360 dnl is, we define HAVE_clockid 361 AC_DEFUN([SMB_CHECK_CLOCK_ID], 362 [ 363 AC_MSG_CHECKING(for $1) 364 AC_TRY_LINK([ 365 #if TIME_WITH_SYS_TIME 366 # include <sys/time.h> 367 # include <time.h> 368 #else 369 # if HAVE_SYS_TIME_H 370 # include <sys/time.h> 371 # else 372 # include <time.h> 373 # endif 374 #endif 375 ], 376 [ 377 clockid_t clk = $1; 378 ], 379 [ 380 AC_MSG_RESULT(yes) 381 AC_DEFINE(HAVE_$1, 1, 382 [Whether the clock_gettime clock ID $1 is available]) 383 ], 384 [ 385 AC_MSG_RESULT(no) 386 ]) 387 ]) 311 388 m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[m4_include(autoconf-2.60.m4)]) -
vendor/current/lib/replace/libreplace_cc.m4
r414 r740 116 116 AC_CHECK_SIZEOF(long long) 117 117 118 AC_CHECK_TYPE(uint_t, unsigned int)119 118 AC_CHECK_TYPE(int8_t, char) 120 119 AC_CHECK_TYPE(uint8_t, unsigned char) -
vendor/current/lib/replace/libreplace_macros.m4
r414 r740 294 294 } 295 295 ])],[ 296 AS_TR_SH([ac_cv_c_prototype_$1])=yes296 eval AS_TR_SH([ac_cv_c_prototype_$1])=yes 297 297 ],[ 298 AS_TR_SH([ac_cv_c_prototype_$1])=no298 eval AS_TR_SH([ac_cv_c_prototype_$1])=no 299 299 ]) 300 300 ) -
vendor/current/lib/replace/libreplace_network.m4
r478 r740 115 115 fi 116 116 117 dnl The following test is roughl taken from the cvs sources.117 dnl The following test is roughly taken from the cvs sources. 118 118 dnl 119 119 dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet. … … 227 227 ], 228 228 libreplace_cv_HAVE_GETADDRINFO=yes,libreplace_cv_HAVE_GETADDRINFO=no)]) 229 230 if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then 231 # getaddrinfo is broken on some AIX systems 232 # see bug 5910, use our replacements if we detect 233 # a broken system. 234 AC_TRY_RUN([ 235 #include <stddef.h> 236 #include <sys/types.h> 237 #include <sys/socket.h> 238 #include <netdb.h> 239 int main(int argc, const char *argv[]) 240 { 241 struct addrinfo hints = {0,}; 242 struct addrinfo *ppres; 243 const char hostname1[] = "0.0.0.0"; 244 const char hostname2[] = "127.0.0.1"; 245 const char hostname3[] = "::"; 246 hints.ai_socktype = SOCK_STREAM; 247 hints.ai_family = AF_UNSPEC; 248 hints.ai_flags = 249 AI_NUMERICHOST|AI_PASSIVE|AI_ADDRCONFIG; 250 /* Test for broken flag combination on AIX. */ 251 if (getaddrinfo(hostname1, NULL, &hints, &ppres) == EAI_BADFLAGS) { 252 /* This fails on an IPv6-only box, but not with 253 the EAI_BADFLAGS error. */ 254 return 1; 255 } 256 if (getaddrinfo(hostname2, NULL, &hints, &ppres) == 0) { 257 /* IPv4 lookup works - good enough. */ 258 return 0; 259 } 260 /* Uh-oh, no IPv4. Are we IPv6-only ? */ 261 return getaddrinfo(hostname3, NULL, &hints, &ppres) != 0 ? 1 : 0; 262 }], 263 libreplace_cv_HAVE_GETADDRINFO=yes, 264 libreplace_cv_HAVE_GETADDRINFO=no) 265 fi 266 229 267 if test x"$libreplace_cv_HAVE_GETADDRINFO" = x"yes"; then 230 268 AC_DEFINE(HAVE_GETADDRINFO,1,[Whether the system has getaddrinfo]) -
vendor/current/lib/replace/replace.c
r414 r740 4 4 Copyright (C) Andrew Tridgell 1992-1998 5 5 Copyright (C) Jelmer Vernooij 2005-2008 6 Copyright (C) Matthieu Patou 2010 6 7 7 8 ** NOTE! The following LGPL license applies to the replace … … 410 411 { 411 412 /* have a reasonable go at emulating it. Hope that 412 the system mktemp() isn't complet ly hopeless */413 the system mktemp() isn't completely hopeless */ 413 414 char *p = mktemp(template); 414 415 if (!p) … … 503 504 #endif 504 505 506 505 507 #ifndef HAVE_STRTOLL 506 508 long long int rep_strtoll(const char *str, char **endptr, int base) … … 516 518 #endif 517 519 } 518 #endif 520 #else 521 #ifdef HAVE_BSD_STRTOLL 522 #ifdef HAVE_STRTOQ 523 long long int rep_strtoll(const char *str, char **endptr, int base) 524 { 525 long long int nb = strtoq(str, endptr, base); 526 /* In linux EINVAL is only returned if base is not ok */ 527 if (errno == EINVAL) { 528 if (base == 0 || (base >1 && base <37)) { 529 /* Base was ok so it's because we were not 530 * able to make the convertion. 531 * Let's reset errno. 532 */ 533 errno = 0; 534 } 535 } 536 return nb; 537 } 538 #else 539 #error "You need the strtoq function" 540 #endif /* HAVE_STRTOQ */ 541 #endif /* HAVE_BSD_STRTOLL */ 542 #endif /* HAVE_STRTOLL */ 519 543 520 544 … … 532 556 #endif 533 557 } 534 #endif 558 #else 559 #ifdef HAVE_BSD_STRTOLL 560 #ifdef HAVE_STRTOUQ 561 unsigned long long int rep_strtoull(const char *str, char **endptr, int base) 562 { 563 unsigned long long int nb = strtouq(str, endptr, base); 564 /* In linux EINVAL is only returned if base is not ok */ 565 if (errno == EINVAL) { 566 if (base == 0 || (base >1 && base <37)) { 567 /* Base was ok so it's because we were not 568 * able to make the convertion. 569 * Let's reset errno. 570 */ 571 errno = 0; 572 } 573 } 574 return nb; 575 } 576 #else 577 #error "You need the strtouq function" 578 #endif /* HAVE_STRTOUQ */ 579 #endif /* HAVE_BSD_STRTOLL */ 580 #endif /* HAVE_STRTOULL */ 535 581 536 582 #ifndef HAVE_SETENV … … 682 728 } 683 729 #endif 730 731 732 #ifndef HAVE_MEMMEM 733 void *rep_memmem(const void *haystack, size_t haystacklen, 734 const void *needle, size_t needlelen) 735 { 736 if (needlelen == 0) { 737 return discard_const(haystack); 738 } 739 while (haystacklen >= needlelen) { 740 char *p = (char *)memchr(haystack, *(const char *)needle, 741 haystacklen-(needlelen-1)); 742 if (!p) return NULL; 743 if (memcmp(p, needle, needlelen) == 0) { 744 return p; 745 } 746 haystack = p+1; 747 haystacklen -= (p - (const char *)haystack) + 1; 748 } 749 return NULL; 750 } 751 #endif 752 753 #ifndef HAVE_VDPRINTF 754 int rep_vdprintf(int fd, const char *format, va_list ap) 755 { 756 char *s = NULL; 757 int ret; 758 759 vasprintf(&s, format, ap); 760 if (s == NULL) { 761 errno = ENOMEM; 762 return -1; 763 } 764 ret = write(fd, s, strlen(s)); 765 free(s); 766 return ret; 767 } 768 #endif 769 770 #ifndef HAVE_DPRINTF 771 int rep_dprintf(int fd, const char *format, ...) 772 { 773 int ret; 774 va_list ap; 775 776 va_start(ap, format); 777 ret = vdprintf(fd, format, ap); 778 va_end(ap); 779 780 return ret; 781 } 782 #endif 783 784 #ifndef HAVE_GET_CURRENT_DIR_NAME 785 char *rep_get_current_dir_name(void) 786 { 787 char buf[PATH_MAX+1]; 788 char *p; 789 p = getcwd(buf, sizeof(buf)); 790 if (p == NULL) { 791 return NULL; 792 } 793 return strdup(p); 794 } 795 #endif 796 797 #if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE) 798 int rep_strerror_r(int errnum, char *buf, size_t buflen) 799 { 800 char *s = strerror(errnum); 801 if (strlen(s)+1 > buflen) { 802 errno = ERANGE; 803 return -1; 804 } 805 strncpy(buf, s, buflen); 806 return 0; 807 } 808 #endif 809 810 #ifndef HAVE_CLOCK_GETTIME 811 int rep_clock_gettime(clockid_t clk_id, struct timespec *tp) 812 { 813 struct timeval tval; 814 switch (clk_id) { 815 case 0: /* CLOCK_REALTIME :*/ 816 #ifdef HAVE_GETTIMEOFDAY_TZ 817 gettimeofday(&tval,NULL); 818 #else 819 gettimeofday(&tval); 820 #endif 821 tp->tv_sec = tval.tv_sec; 822 tp->tv_nsec = tval.tv_usec * 1000; 823 break; 824 default: 825 errno = EINVAL; 826 return -1; 827 } 828 return 0; 829 } 830 #endif -
vendor/current/lib/replace/replace.h
r414 r740 82 82 # define PRIi8 "i" 83 83 #endif 84 #ifndef PRIi 884 #ifndef PRIi16 85 85 # define PRIi16 "i" 86 86 #endif 87 #ifndef PRIi 887 #ifndef PRIi32 88 88 # define PRIi32 "i" 89 89 #endif 90 #ifndef PRIi 890 #ifndef PRIi64 91 91 # define PRIi64 __PRI64_PREFIX "i" 92 92 #endif … … 122 122 #endif 123 123 124 #ifdef HAVE_LINUX_TYPES_H 125 /* 126 * This is needed as some broken header files require this to be included early 127 */ 128 #include <linux/types.h> 129 #endif 130 124 131 #ifndef HAVE_STRERROR 125 132 extern char *sys_errlist[]; … … 139 146 #define memmove rep_memmove 140 147 void *rep_memmove(void *dest,const void *src,int size); 148 #endif 149 150 #ifndef HAVE_MEMMEM 151 #define memmem rep_memmem 152 void *rep_memmem(const void *haystack, size_t haystacklen, 153 const void *needle, size_t needlelen); 141 154 #endif 142 155 … … 278 291 #endif 279 292 293 294 280 295 #ifndef HAVE_STRTOLL 281 296 #define strtoll rep_strtoll 282 297 long long int rep_strtoll(const char *str, char **endptr, int base); 298 #else 299 #ifdef HAVE_BSD_STRTOLL 300 #define strtoll rep_strtoll 301 long long int rep_strtoll(const char *str, char **endptr, int base); 302 #endif 283 303 #endif 284 304 … … 286 306 #define strtoull rep_strtoull 287 307 unsigned long long int rep_strtoull(const char *str, char **endptr, int base); 308 #else 309 #ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */ 310 #define strtoull rep_strtoull 311 unsigned long long int rep_strtoull(const char *str, char **endptr, int base); 312 #endif 288 313 #endif 289 314 … … 329 354 #define socketpair rep_socketpair 330 355 /* prototype is in system/network.h */ 356 #endif 357 358 #ifndef HAVE_VDPRINTF 359 #define vdprintf rep_vdprintf 360 int rep_vdprintf(int fd, const char *format, va_list ap); 361 #endif 362 363 #ifndef HAVE_DPRINTF 364 #define dprintf rep_dprintf 365 int rep_dprintf(int fd, const char *format, ...); 331 366 #endif 332 367 … … 490 525 #define freeifaddrs rep_freeifaddrs 491 526 /* prototype is in "system/network.h" */ 527 #endif 528 529 #ifndef HAVE_GET_CURRENT_DIR_NAME 530 #define get_current_dir_name rep_get_current_dir_name 531 char *rep_get_current_dir_name(void); 532 #endif 533 534 #if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE) 535 #undef strerror_r 536 #define strerror_r rep_strerror_r 537 int rep_strerror_r(int errnum, char *buf, size_t buflen); 538 #endif 539 540 #if !defined(HAVE_CLOCK_GETTIME) 541 #define clock_gettime rep_clock_gettime 492 542 #endif 493 543 … … 724 774 #endif 725 775 776 #ifndef HAVE_FDATASYNC 777 #define fdatasync(fd) fsync(fd) 778 #elif !defined(HAVE_DECL_FDATASYNC) 779 int fdatasync(int ); 780 #endif 781 782 /* these are used to mark symbols as local to a shared lib, or 783 * publicly available via the shared lib API */ 784 #ifndef _PUBLIC_ 785 #ifdef HAVE_VISIBILITY_ATTR 786 #define _PUBLIC_ __attribute__((visibility("default"))) 787 #else 788 #define _PUBLIC_ 789 #endif 790 #endif 791 792 #ifndef _PRIVATE_ 793 #ifdef HAVE_VISIBILITY_ATTR 794 # define _PRIVATE_ __attribute__((visibility("hidden"))) 795 #else 796 # define _PRIVATE_ 797 #endif 798 #endif 799 800 #ifndef HAVE_POLL 801 #define poll rep_poll 802 /* prototype is in "system/network.h" */ 803 #endif 804 726 805 #endif /* _LIBREPLACE_REPLACE_H */ -
vendor/current/lib/replace/system/config.m4
r618 r740 7 7 AC_CHECK_HEADERS(sys/select.h) 8 8 9 # poll 10 AC_CHECK_HEADERS(poll.h) 11 AC_CHECK_FUNCS(poll,[],[LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/poll.o"]) 12 9 13 # time 10 14 AC_CHECK_HEADERS(sys/time.h utime.h) 11 15 AC_HEADER_TIME 12 16 AC_CHECK_FUNCS(utime utimes) 17 18 AC_CACHE_CHECK([if gettimeofday takes TZ argument],libreplace_cv_HAVE_GETTIMEOFDAY_TZ,[ 19 AC_TRY_RUN([ 20 #include <sys/time.h> 21 #include <unistd.h> 22 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}], 23 libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=no,libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes)]) 24 if test x"$libreplace_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then 25 AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available]) 26 fi 13 27 14 28 # wait -
vendor/current/lib/replace/system/network.h
r478 r740 308 308 #define ss_family sin6_family 309 309 #define HAVE_SS_FAMILY 1 310 #else 310 #else /*HAVE_STRUCT_SOCKADDR_IN6*/ 311 311 #define sockaddr_storage sockaddr_in 312 312 #define ss_family sin_family 313 313 #define HAVE_SS_FAMILY 1 314 #endif 315 #endif 314 #endif /*HAVE_STRUCT_SOCKADDR_IN6*/ 315 #endif /*HAVE_STRUCT_SOCKADDR_STORAGE*/ 316 316 317 317 #ifndef HAVE_SS_FAMILY … … 332 332 */ 333 333 # define IOV_MAX 512 334 # else335 # error IOV_MAX and UIO_MAXIOV undefined336 334 # endif 337 335 # endif -
vendor/current/lib/replace/system/passwd.h
r414 r740 102 102 103 103 #ifdef NSS_WRAPPER 104 #ifndef NSS_WRAPPER_DISABLE 104 105 #ifndef NSS_WRAPPER_NOT_REPLACE 105 106 #define NSS_WRAPPER_REPLACE 106 #endif 107 #endif /* NSS_WRAPPER_NOT_REPLACE */ 107 108 #include "../nss_wrapper/nss_wrapper.h" 108 #endif 109 #endif /* NSS_WRAPPER_DISABLE */ 110 #endif /* NSS_WRAPPER */ 109 111 110 112 #endif -
vendor/current/lib/replace/system/readline.h
r414 r740 44 44 45 45 #ifdef HAVE_NEW_LIBREADLINE 46 # define RL_COMPLETION_CAST (rl_completion_func_t *) 46 #ifdef HAVE_CPPFUNCTION 47 # define RL_COMPLETION_CAST (CPPFunction *) 48 #elif HAVE_RL_COMPLETION_T 49 # define RL_COMPLETION_CAST (rl_completion_t *) 50 #else 51 # define RL_COMPLETION_CAST 52 #endif 47 53 #else 48 54 /* This type is missing from libreadline<4.0 (approximately) */ -
vendor/current/lib/replace/system/select.h
r414 r740 39 39 #endif 40 40 41 #ifdef HAVE_POLL 42 43 #include <poll.h> 44 45 #else 46 47 /* Type used for the number of file descriptors. */ 48 typedef unsigned long int nfds_t; 49 50 /* Data structure describing a polling request. */ 51 struct pollfd 52 { 53 int fd; /* File descriptor to poll. */ 54 short int events; /* Types of events poller cares about. */ 55 short int revents; /* Types of events that actually occurred. */ 56 }; 57 58 /* Event types that can be polled for. These bits may be set in `events' 59 to indicate the interesting event types; they will appear in `revents' 60 to indicate the status of the file descriptor. */ 61 #define POLLIN 0x001 /* There is data to read. */ 62 #define POLLPRI 0x002 /* There is urgent data to read. */ 63 #define POLLOUT 0x004 /* Writing now will not block. */ 64 #define POLLRDNORM 0x040 /* Normal data may be read. */ 65 #define POLLRDBAND 0x080 /* Priority data may be read. */ 66 #define POLLWRNORM 0x100 /* Writing now will not block. */ 67 #define POLLWRBAND 0x200 /* Priority data may be written. */ 68 #define POLLERR 0x008 /* Error condition. */ 69 #define POLLHUP 0x010 /* Hung up. */ 70 #define POLLNVAL 0x020 /* Invalid polling request. */ 71 72 /* define is in "replace.h" */ 73 int rep_poll(struct pollfd *fds, nfds_t nfds, int timeout); 74 41 75 #endif 76 77 #endif -
vendor/current/lib/replace/system/time.h
r414 r740 47 47 #endif 48 48 49 #ifndef HAVE_STRUCT_TIMESPEC 50 struct timespec { 51 time_t tv_sec; /* Seconds. */ 52 long tv_nsec; /* Nanoseconds. */ 53 }; 54 #endif 55 49 56 #ifndef HAVE_MKTIME 50 57 /* define is in "replace.h" */ … … 67 74 #endif 68 75 76 #ifndef HAVE_CLOCK_GETTIME 77 /* CLOCK_REALTIME is required by POSIX */ 78 #define CLOCK_REALTIME 0 79 typedef int clockid_t; 80 int rep_clock_gettime(clockid_t clk_id, struct timespec *tp); 69 81 #endif 82 /* make sure we have a best effort CUSTOM_CLOCK_MONOTONIC we can rely on */ 83 #if defined(CLOCK_MONOTONIC) 84 #define CUSTOM_CLOCK_MONOTONIC CLOCK_MONOTONIC 85 #elif defined(CLOCK_HIGHRES) 86 #define CUSTOM_CLOCK_MONOTONIC CLOCK_HIGHRES 87 #else 88 #define CUSTOM_CLOCK_MONOTONIC CLOCK_REALTIME 89 #endif 90 91 #endif -
vendor/current/lib/replace/system/wait.h
r618 r740 37 37 #endif 38 38 39 #ifndef SIGNAL_CAST40 #define SIGNAL_CAST (RETSIGTYPE (*)(int))41 #endif42 43 39 #ifdef HAVE_SETJMP_H 44 40 #include <setjmp.h> -
vendor/current/lib/replace/test/os2_delete.c
r414 r740 47 47 char fname[40]; 48 48 int fd; 49 s printf(fname, TESTDIR "/test%u.txt", i);49 snprintf(fname, sizeof(fname), TESTDIR "/test%u.txt", i); 50 50 fd = open(fname, O_CREAT|O_RDWR, 0600); 51 51 if (fd < 0) { … … 80 80 for (j=0; j<MIN(i, DELETE_SIZE); j++) { 81 81 char fname[40]; 82 s printf(fname, TESTDIR "/%s", names[j]);82 snprintf(fname, sizeof(fname), TESTDIR "/%s", names[j]); 83 83 unlink(fname) == 0 || FAILED("unlink"); 84 84 } -
vendor/current/lib/replace/test/testsuite.c
r414 r740 752 752 bool 753 753 socklen_t 754 uint_t755 754 uint{8,16,32,64}_t 756 755 int{8,16,32,64}_t … … 773 772 printf("test: FUNCTION\n"); 774 773 if (strcmp(__FUNCTION__, "test_FUNCTION") != 0) { 775 printf("failure: F AILURE [\nFAILUREinvalid\n]\n");774 printf("failure: FUNCTION [\nFUNCTION invalid\n]\n"); 776 775 return false; 777 776 } … … 1015 1014 return true; 1016 1015 } 1016 1017 static int test_memmem(void) 1018 { 1019 char *s; 1020 1021 printf("test: memmem\n"); 1022 1023 s = (char *)memmem("foo", 3, "fo", 2); 1024 if (strcmp(s, "foo") != 0) { 1025 printf(__location__ ": Failed memmem\n"); 1026 return false; 1027 } 1028 1029 s = (char *)memmem("foo", 3, "", 0); 1030 /* it is allowable for this to return NULL (as happens on 1031 FreeBSD) */ 1032 if (s && strcmp(s, "foo") != 0) { 1033 printf(__location__ ": Failed memmem\n"); 1034 return false; 1035 } 1036 1037 s = (char *)memmem("foo", 4, "o", 1); 1038 if (strcmp(s, "oo") != 0) { 1039 printf(__location__ ": Failed memmem\n"); 1040 return false; 1041 } 1042 1043 s = (char *)memmem("foobarfodx", 11, "fod", 3); 1044 if (strcmp(s, "fodx") != 0) { 1045 printf(__location__ ": Failed memmem\n"); 1046 return false; 1047 } 1048 1049 printf("success: memmem\n"); 1050 1051 return true; 1052 } 1053 1017 1054 1018 1055 struct torture_context; … … 1066 1103 ret &= test_utime(); 1067 1104 ret &= test_utimes(); 1105 ret &= test_memmem(); 1068 1106 1069 1107 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.