On Thu, Feb 14, 2019 at 4:21 PM Ted Unangst <t...@tedunangst.com> wrote:
> Alexander Bluhm wrote: > > GNU dd has the conv=fsync feature which does an fsync(2) after final > > write to output. I find this useful for write performance measurement > > through the file system without buffer cache optimization. Others > > may like the reliable storage guarantee of fsync(2). > > > > Do we want dd conv=fsync in OpenBSD? > > What does gnu dd do if the output is stdout? Is it an error? > > With this patch, I get dd: fsync stdout: Invalid argument > gnu dd prints something similar to stderr, and returns exit code 1. dd: fsync failed for 'standard output': Invalid argument 3+1 records in 3+1 records out 1784 bytes (1.8 kB, 1.7 KiB) copied, 9.4827e-05 s, 18.8 MB/s > after the transfer is complete. Should there be an fstat check to make sure > it's a regular file? > > > +.It Cm fsync > > +Write output to permanent storage device before finishing. > > I know this wording is similar to fsync(2), but I think I'd prefer just a > reference. The output may not be permanent storage. What about > > Call > .Xr fsync 2 > on the output file before exiting. > > >