| 339 |
size is greater than 512 bytes; so ST_BLKSIZE code below, in preparation |
size is greater than 512 bytes; so ST_BLKSIZE code below, in preparation |
| 340 |
for some cleanup in this area, later. */ |
for some cleanup in this area, later. */ |
| 341 |
|
|
|
/* Get or fake the disk device blocksize. Usually defined by sys/param.h |
|
|
(if at all). */ |
|
|
|
|
|
#if !defined(DEV_BSIZE) && defined(BSIZE) |
|
|
# define DEV_BSIZE BSIZE |
|
|
#endif |
|
|
#if !defined(DEV_BSIZE) && defined(BBSIZE) /* SGI */ |
|
|
# define DEV_BSIZE BBSIZE |
|
|
#endif |
|
|
#ifndef DEV_BSIZE |
|
|
# define DEV_BSIZE 4096 |
|
|
#endif |
|
|
|
|
| 342 |
/* Extract or fake data from a `struct stat'. ST_BLKSIZE gives the |
/* Extract or fake data from a `struct stat'. ST_BLKSIZE gives the |
| 343 |
optimal I/O blocksize for the file, in bytes. Some systems, like |
optimal I/O blocksize for the file, in bytes. Some systems, like |
| 344 |
Sequents, return st_blksize of 0 on pipes. */ |
Sequents, return st_blksize of 0 on pipes. */ |
| 345 |
|
|
| 346 |
|
#define DEFAULT_ST_BLKSIZE 512 |
| 347 |
|
|
| 348 |
#if !HAVE_ST_BLKSIZE |
#if !HAVE_ST_BLKSIZE |
| 349 |
# define ST_BLKSIZE(Statbuf) DEV_BSIZE |
# define ST_BLKSIZE(Statbuf) DEFAULT_ST_BLKSIZE |
| 350 |
#else |
#else |
| 351 |
# define ST_BLKSIZE(Statbuf) \ |
# define ST_BLKSIZE(Statbuf) \ |
| 352 |
((Statbuf).st_blksize > 0 ? (Statbuf).st_blksize : DEV_BSIZE) |
((Statbuf).st_blksize > 0 ? (Statbuf).st_blksize : DEFAULT_ST_BLKSIZE) |
| 353 |
#endif |
#endif |
| 354 |
|
|
| 355 |
/* Extract or fake data from a `struct stat'. ST_NBLOCKS gives the |
/* Extract or fake data from a `struct stat'. ST_NBLOCKS gives the |
| 511 |
#if XENIX |
#if XENIX |
| 512 |
# include <sys/inode.h> |
# include <sys/inode.h> |
| 513 |
#endif |
#endif |
|
|
|
|
|
|