wmeissner/jnr-posix — pull request #4 by jeremyevans (2012-02-23 03:32:25+00:00)
Title: Fix OpenBSDHeapFileStat

I haven't tested this, but according to my OpenBSD system headers:

/usr/include/sys/stat.h: nlink_t st_nlink; /* number of hard links */
/usr/include/sys/types.h:typedef __nlink_t nlink_t; /* link count */
/usr/include/sys/_types.h:typedef __uint32_t __nlink_t; /* link count */

/usr/include/sys/stat.h: mode_t st_mode; /* inode protection mode */
/usr/include/sys/types.h:typedef __mode_t mode_t; /* permissions */
/usr/include/sys/_types.h:typedef __uint32_t __mode_t; /* permissions */

This would explain the results I'm seeing in my OpenBSD systems, where
st_dev, st_ino, and st_mode are correct, and later fields are wrong.