<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 28, 2016, at 8:27 AM, Hubertus Franke &lt;<a href="mailto:notifications@github.com" class="">notifications@github.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><p class="">In <a href="https://github.com/apple/swift-corelibs-libdispatch/pull/39#discussion_r51145862" class="">src/io.c</a>:</p>
<pre style="color:#555" class="">&gt; @@ -2088,6 +2093,14 @@ _dispatch_operation_advise(dispatch_operation_t op, size_t chunk_size)
&gt;          }
&gt;          advise.ra_offset = op-&gt;advise_offset;
&gt;          op-&gt;advise_offset += advise.ra_count;
&gt; +#ifdef __linux__
&gt; +        _dispatch_io_syscall_switch(err,
&gt; +                readahead(op-&gt;fd_entry-&gt;fd, advise.ra_offset, advise.ra_count),
&gt; +                case EBADF: break; // bad file desciptor
</pre><p class="">I mean both should NOT be ignored and caught by dispatch_assume_zero()</p><p style="font-size:small;-webkit-text-size-adjust:none;color:#666;" class="">—<br class="">Reply to this email directly or <a href="https://github.com/apple/swift-corelibs-libdispatch/pull/39/files#r51145862" class="">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AACupDMoSEFvT6AdLNEaicXY5yNvqLtAks5pejjvgaJpZM4HOXnI.gif" width="1" class=""></p>
<div itemscope="" itemtype="http://schema.org/EmailMessage" class="">
<div itemprop="action" itemscope="" itemtype="http://schema.org/ViewAction" class="">
  <link itemprop="url" href="https://github.com/apple/swift-corelibs-libdispatch/pull/39/files#r51145862" class="">
  <meta itemprop="name" content="View Pull Request" class="">
</div>
<meta itemprop="description" content="View this Pull Request on GitHub" class="">
</div>
</div></blockquote></div><br class=""><div class="">Not sure where the pull request went, but you have to ignore EINVAL because when a dispatch_io is created the developer doesn’t *know* that this file-descriptor type doesn’t have kernel support for readahead() so it’s fine, it is NOT a programmer error, he can’t possibly know. This is ENOTSUP for the radvise call on OS X and is ignored.</div><div class=""><br class=""></div><div class="">EBADF is different because it means the underlying fd was closed under dispatch_io feet, or a non open one was passed or something similar which *is* a programmer error.</div><div class=""><br class=""></div><div class="">-Pierre</div></body></html>