This is what I had to do to a UNIX code to compile on QNX4:
if (stat(file, &sb) < 0)
/* For sparse files, return the size based on number of blocks
if (sb.st_size / DEV_BSIZE > sb.st_blocks)
return (sb.st_blocks * DEV_BSIZE);
First I did try to #include <machine/param.h> to have DEV_BSIZE defined,
then I removed it for I got the error of not having the “st_blocks” in the
Is it OK?
Is there a cleaner work-around?