Changeset 1272
- Timestamp:
- 09/18/08 20:36:09 (2 months ago)
- Files:
-
- 1.8.3/branches/devel/config.h.in (modified) (1 diff)
- 1.8.3/branches/devel/configure (modified) (2 diffs)
- 1.8.3/branches/devel/configure.in (modified) (1 diff)
- 1.8.3/branches/devel/src/chunk.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/config.h.in
r1258 r1272 317 317 #endif 318 318 319 #undef HAVE_PREAD 320 321 #undef HAVE_PWRITE 322 319 323 /* Variables and defines */ 320 324 1.8.3/branches/devel/configure
r1271 r1272 12488 12488 12489 12489 if test ! -x "$PG_CONFIG"; then 12490 { $as_echo "$as_me:$LINENO: WARNING: $PG_CONFIG does not exist or it is not an exectuable file" >&512491 $as_echo "$as_me: WARNING: $PG_CONFIG does not exist or it is not an exectuable file" >&2;}12492 12490 PG_CONFIG="no" 12493 12491 found_postgresql="no" … … 15569 15567 15570 15568 for ac_func in fcntl pselect poll ppoll pollts kqueue epoll_ctl inotify_init 15569 do 15570 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 15571 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 15572 $as_echo_n "checking for $ac_func... " >&6; } 15573 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then 15574 $as_echo_n "(cached) " >&6 15575 else 15576 cat >conftest.$ac_ext <<_ACEOF 15577 /* confdefs.h. */ 15578 _ACEOF 15579 cat confdefs.h >>conftest.$ac_ext 15580 cat >>conftest.$ac_ext <<_ACEOF 15581 /* end confdefs.h. */ 15582 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. 15583 For example, HP-UX 11i <limits.h> declares gettimeofday. */ 15584 #define $ac_func innocuous_$ac_func 15585 15586 /* System header to define __stub macros and hopefully few prototypes, 15587 which can conflict with char $ac_func (); below. 15588 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 15589 <limits.h> exists even on freestanding compilers. */ 15590 15591 #ifdef __STDC__ 15592 # include <limits.h> 15593 #else 15594 # include <assert.h> 15595 #endif 15596 15597 #undef $ac_func 15598 15599 /* Override any GCC internal prototype to avoid an error. 15600 Use char because int might match the return type of a GCC 15601 builtin and then its argument prototype would still apply. */ 15602 #ifdef __cplusplus 15603 extern "C" 15604 #endif 15605 char $ac_func (); 15606 /* The GNU C library defines this for functions which it implements 15607 to always fail with ENOSYS. Some functions are actually named 15608 something starting with __ and the normal name is an alias. */ 15609 #if defined __stub_$ac_func || defined __stub___$ac_func 15610 choke me 15611 #endif 15612 15613 int 15614 main () 15615 { 15616 return $ac_func (); 15617 ; 15618 return 0; 15619 } 15620 _ACEOF 15621 rm -f conftest.$ac_objext conftest$ac_exeext 15622 if { (ac_try="$ac_link" 15623 case "(($ac_try" in 15624 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 15625 *) ac_try_echo=$ac_try;; 15626 esac 15627 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 15628 $as_echo "$ac_try_echo") >&5 15629 (eval "$ac_link") 2>conftest.er1 15630 ac_status=$? 15631 grep -v '^ *+' conftest.er1 >conftest.err 15632 rm -f conftest.er1 15633 cat conftest.err >&5 15634 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 15635 (exit $ac_status); } && { 15636 test -z "$ac_c_werror_flag" || 15637 test ! -s conftest.err 15638 } && test -s conftest$ac_exeext && { 15639 test "$cross_compiling" = yes || 15640 $as_test_x conftest$ac_exeext 15641 }; then 15642 eval "$as_ac_var=yes" 15643 else 15644 $as_echo "$as_me: failed program was:" >&5 15645 sed 's/^/| /' conftest.$ac_ext >&5 15646 15647 eval "$as_ac_var=no" 15648 fi 15649 15650 rm -rf conftest.dSYM 15651 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 15652 conftest$ac_exeext conftest.$ac_ext 15653 fi 15654 ac_res=`eval 'as_val=${'$as_ac_var'} 15655 $as_echo "$as_val"'` 15656 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 15657 $as_echo "$ac_res" >&6; } 15658 as_val=`eval 'as_val=${'$as_ac_var'} 15659 $as_echo "$as_val"'` 15660 if test "x$as_val" = x""yes; then 15661 cat >>confdefs.h <<_ACEOF 15662 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 15663 _ACEOF 15664 15665 fi 15666 done 15667 15668 15669 15670 for ac_func in pread pwrite 15571 15671 do 15572 15672 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` 1.8.3/branches/devel/configure.in
r1271 r1272 225 225 AC_CHECK_FUNCS([socketpair sigaction sigprocmask valloc writev]) 226 226 AC_CHECK_FUNCS([fcntl pselect poll ppoll pollts kqueue epoll_ctl inotify_init]) 227 AC_CHECK_FUNCS([pread pwrite]) 227 228 228 229 AC_FUNC_SNPRINTF 1.8.3/branches/devel/src/chunk.c
r918 r1272 224 224 #include <io.h> 225 225 #else 226 #define _XOPEN_SOURCE 500 226 227 #include <unistd.h> 227 228 #endif … … 1240 1241 char *pos; 1241 1242 size_t remaining; 1242 int done;1243 ssize_t done; 1243 1244 1244 1245 debug_log("read_cache_region %04x", region); 1245 1246 1247 #ifndef HAVE_PREAD 1246 1248 /* Try to seek up to 3 times... */ 1247 1249 for (j = 0; j < 3; j++) … … 1259 1261 mush_panicf("chunk swap file seek, errno %d: %s", errno, strerror(errno)); 1260 1262 #endif 1263 #endif /* !HAVE_PREAD */ 1261 1264 pos = (char *) rhp; 1262 1265 remaining = REGION_SIZE; 1263 1266 for (j = 0; j < 10; j++) { 1264 #ifdef WIN32 1265 #ifndef __MINGW32__ 1267 #if defined(HAVE_PREAD) 1268 done = pread(fd, pos, remaining, file_offset); 1269 #elif defined(WIN32) && !defined(__MINGW32__) 1266 1270 if (!ReadFile(fd, pos, remaining, &done, NULL)) { 1267 1271 /* nothing */ 1268 1272 } 1269 #endif1270 1273 #else 1271 1274 done = read(fd, pos, remaining); … … 1274 1277 remaining -= done; 1275 1278 pos += done; 1279 file_offset += done; 1276 1280 if (!remaining) 1277 1281 return; 1278 1282 } 1279 #ifndef WIN321280 if (done == -1 && errno == EAGAIN)1281 sleep(0);1282 #endif1283 1283 } 1284 1284 #ifdef WIN32 … … 1302 1302 int j; 1303 1303 char *pos; 1304 size_t remaining; 1305 int done;1304 size_t remaining; 1305 ssize_t done; 1306 1306 1307 1307 debug_log("write_cache_region %04x", region); 1308 1308 1309 #ifndef HAVE_PWRITE 1309 1310 /* Try to seek up to 3 times... */ 1310 1311 for (j = 0; j < 3; j++) … … 1322 1323 mush_panicf("chunk swap file seek, errno %d: %s", errno, strerror(errno)); 1323 1324 #endif 1325 #endif /* !HAVE_PWRITE */ 1324 1326 pos = (char *) rhp; 1325 1327 remaining = REGION_SIZE; 1328 1329 /* SW: I'm not sure why Talek has this loop so many times -- the 1330 only recoverable way the writes should fail is if they're 1331 interrupted by a signal and can't be restarted for some 1332 reason. */ 1326 1333 for (j = 0; j < 10; j++) { 1327 #ifdef WIN32 1328 #ifndef __MINGW32__ 1334 1335 #if defined(HAVE_PWRITE 1336 done = pwrite(fd, pos, remaining, file_offset); 1337 #elif defined(WIN32) && !defined(__MINGW32__) 1329 1338 if (!WriteFile(fd, pos, remaining, &done, NULL)) { 1330 1339 /* nothing */ … … 1333 1342 done = write(fd, pos, remaining); 1334 1343 #endif 1335 #else1336 done = write(fd, pos, remaining);1337 #endif1338 1344 if (done >= 0) { 1339 1345 remaining -= done; 1340 1346 pos += done; 1347 file_offset += done; 1341 1348 if (!remaining) 1342 1349 return; 1343 1350 } 1344 #ifndef WIN32 1345 if (done == -1 && errno == EAGAIN) 1346 sleep(0); 1347 #endif 1348 } 1351 } 1352 #endif 1349 1353 #ifdef WIN32 1350 1354 mush_panicf("chunk swap file write, %lu remaining, GetLastError %d", … … 1353 1357 mush_panicf("chunk swap file write, %lu remaining, errno %d: %s", 1354 1358 (unsigned long) remaining, errno, strerror(errno)); 1355 #endif1356 1359 } 1357 1360
