1

在 Linux (Ubuntu 14.04) 上,使用默认的 python (2.7.6),以下工作可以正确地将 stdin 的所有者设置为当前进程,以便我们接收 SIGIO 中断:

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

但是在 OS X (10.9.2) 上,默认 python (2.7.5) 中的同一行返回:

IOError: [Errno 25] Inappropriate ioctl for device

fcntl 或 Linux 等效的 OS X 手册页或 python 文档都没有提供任何帮助。

发生了什么?

4

0 回答 0