Changeset 2850 in kBuild
- Timestamp:
- Aug 30, 2016 4:06:31 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/dir.c
r2773 r2850 594 594 if (HASH_VACANT (dc)) 595 595 { 596 #if defined(WINDOWS32) && defined(KMK) 597 static char s_last_volume[4]; 598 static int s_last_flags; 599 #endif 596 600 /* Nope; this really is a directory we haven't seen before. */ 597 601 … … 625 629 */ 626 630 w32_path[3] = '\0'; 631 # ifdef KMK /* Need for speed: Cache the GetVolumeInformation result. */ 632 if ( s_last_volume[0] == w32_path[0] 633 && s_last_volume[1] == w32_path[1] 634 && s_last_volume[2] == w32_path[2] 635 && s_last_volume[3] == w32_path[3]) 636 dc->fs_flags = s_last_flags; 637 else 638 { 639 # endif 627 640 if (GetVolumeInformation(w32_path, 628 641 fs_label, sizeof (fs_label), … … 636 649 else 637 650 dc->fs_flags = FS_UNKNOWN; 651 # ifdef KMK 652 s_last_volume[0] = w32_path[0]; 653 s_last_volume[1] = w32_path[1]; 654 s_last_volume[2] = w32_path[2]; 655 s_last_volume[3] = w32_path[3]; 656 s_last_flags = dc->fs_flags; 657 } 658 # endif 638 659 #else 639 660 # ifdef VMS -
trunk/src/kmk/incdep.c
r2745 r2850 502 502 return -1; 503 503 } 504 #ifdef KBUILD_OS_WINDOWS /* fewer kernel calls */ 505 if (!birdStatOnFdJustSize (fd, &st.st_size)) 506 #else 504 507 if (!fstat (fd, &st)) 508 #endif 505 509 { 506 510 cur->file_base = incdep_xmalloc (cur, st.st_size + 1); -
trunk/src/lib/nt/ntstat.c
r2710 r2850 534 534 535 535 /** 536 * Special case that only gets the file size and nothing else. 537 */ 538 int birdStatOnFdJustSize(int fd, __int64 *pcbFile) 539 { 540 int rc; 541 HANDLE hFile = (HANDLE)_get_osfhandle(fd); 542 if (hFile != INVALID_HANDLE_VALUE) 543 { 544 LARGE_INTEGER cbLocal; 545 if (GetFileSizeEx(hFile, &cbLocal)) 546 { 547 *pcbFile = cbLocal.QuadPart; 548 rc = 0; 549 } 550 else 551 { 552 BirdStat_T Stat; 553 rc = birdStatOnFd(fd, &Stat); 554 if (rc == 0) 555 *pcbFile = Stat.st_size; 556 } 557 } 558 else 559 rc = -1; 560 return rc; 561 } 562 563 564 /** 536 565 * Implements UNIX stat(). 537 566 */ -
trunk/src/lib/nt/ntstat.h
r2708 r2850 78 78 int birdStatOnLink(const char *pszPath, BirdStat_T *pStat); 79 79 int birdStatOnFd(int fd, BirdStat_T *pStat); 80 int birdStatOnFdJustSize(int fd, __int64 *pcbFile); 80 81 int birdStatModTimeOnly(const char *pszPath, BirdTimeSpec_T *pTimeSpec, int fFollowLink); 81 82 #ifdef ___nt_ntstuff_h
Note:
See TracChangeset
for help on using the changeset viewer.