Date: Sat, 10 Aug 2019 21:37:34 -0600 From: Alan Somers <asomers@freebsd.org> To: Rick Macklem <rmacklem@uoguelph.ca> Cc: "freebsd-current@FreeBSD.org" <freebsd-current@freebsd.org> Subject: Re: RFC: should lseek(SEEK_DATA/SEEK_HOLE) return ENOTTY? Message-ID: <CAOtMX2iiQdv1%2B15e1N_r7V6aCx_VqAJCTP1AW%2Bqs3Yg7sPg9wA@mail.gmail.com> In-Reply-To: <YTBPR01MB3616B6F068199B6A3329432CDDD00@YTBPR01MB3616.CANPRD01.PROD.OUTLOOK.COM> References: <YTBPR01MB3616B6F068199B6A3329432CDDD00@YTBPR01MB3616.CANPRD01.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 10, 2019 at 8:03 PM Rick Macklem <rmacklem@uoguelph.ca> wrote: > > Hi, > > I've noticed that, if you do a lseek(SEEK_DATA/SEEK_HOLE) on a file that > resides in a file system that does not support holes, ENOTTY is returned. > > This error isn't listed for lseek() and seems a liitle weird. > > I can see a couple of alternatives to this: > 1 - Return a different error. Maybe ENXIO? > or > 2 - Have lseek() do the trivial implementation when the VOP_IOCTL() fails. > - For SEEK_DATA, just return the offset given as argument and for SEEK_HOLE > return the file's size as the offset. I vote option 2. > > What do others think? rick > ps: The man page should be updated, whatever is done w.r.t. this.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2iiQdv1%2B15e1N_r7V6aCx_VqAJCTP1AW%2Bqs3Yg7sPg9wA>