On 2/14/25 23:42, Cedric Blancher wrote:
cc: illumos-dev@ list. How does Solaris or Illumos behave? SUN/Solaris
invented SEEK_DATA/SEEK_HOLE, so this should be - aside from looking
at the OpenGroup/POSIX specs - the reference implementation.

Thanks for asking.

On Illumos, SEEK_DATA fails with ENXIO at EOF, and more generally fails with ENXIO if there are no non-hole regions in the file after the passed offset -- a file may end in a hole, so you may also get ENXIO for offsets less than the file's length.

The lseek manpage says:

...
ERRORS
       The lseek() function will fail if:
...
       ENXIO
           For SEEK_DATA, there are no more data regions past the
           supplied offset.  For SEEK_HOLE, there are no more holes
           past the supplied offset.

                                                - Bill


--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to