Re: xfs behaviour on OpenBSD
Kristaps Johnson <[email protected]>
| Newsgroups | gmane.comp.file-systems.arla.general |
|---|---|
| Message-ID | <[email protected]> |
>> Hello everybody. I wonder if somebody can shed some light on strange >> behahiour (or sloppy thinking on my part). >> >> If I mount_xfs on OpenBSD (3.9), and run two versions of a programme, one >> that read(2)s and one that fread(3)s, the read returns end-of-file while >> the fread returns correct values. > > nnpfs dev will only return untruncted messages, you need to pass in a > larger buffer. > > fread behavies diffrently because its buffered in libc, ktrace and > you'll see that the read(2) is larger then 1 byte. Problem solved. I was trying to read a single sizeof struct nnpfs_message_header and kept receiving eof. I'll revert back to NNPFS_MSG_MAX_DATASIZE. Thank you, Kristaps.