(blksize) [aix, sgi]: Drop special case; I bet these systems support
st_blksize by now.
This commit is contained in:
parent
b0f44690e5
commit
2027ec8046
1 changed files with 3 additions and 6 deletions
|
@ -56,23 +56,20 @@ fsize(int fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return the block size of the filesystem
|
* Return the preferred block size for I/O on FD.
|
||||||
* If it's not a filesystem, return 1024.
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
blksize(int fd)
|
blksize(int fd)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
return 2048;
|
return 2048;
|
||||||
#elif (!defined (aix) && !defined (sgi))
|
#else /* !_WIN32 */
|
||||||
struct stat statb;
|
struct stat statb;
|
||||||
|
|
||||||
if (fstat(fd, &statb) < 0)
|
if (fstat(fd, &statb) < 0)
|
||||||
return 1024;
|
return 1024;
|
||||||
return statb.st_blksize;
|
return statb.st_blksize;
|
||||||
#else
|
#endif /* !_WIN32 */
|
||||||
return 1024;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t
|
time_t
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue