On 23 Apr 2014, at 1:02 pm, Russell Allen <mail@russell-allen.com> wrote:

But I'm not happy yet, because I still can't do proper non-pegging IO on OS X - I can't call setOwnerIfFail: on pipes

It seems as if not being able to successfully call fcntl(pipe, F_SETOWN, pid) on OS X is not Self's fault but an OS X thing.

Easiest illustration of this is probably in python:

import os, sys, fcntl
fcntl.fcntl(sys.stdin, fcntl.F_SETOWN, os.getpid())


IOError: [Errno 25] Inappropriate ioctl for device

same as for Self.  Doing the same on a named pipe gives a 102 error : Operation not supported on socket. Which is interesting given a named pipe isn't a socket.

I can't find this documented anywhere - nothing in man page for fcntl or Apple bug reports db. I have asked on StackOverflow but no one has answered, though someone did give me a 'student' badge, so that's nice.

I am at a little bit of a loss here. We need something better than reading in a loop, or doing select with immediate timeout in a loop.