Skip Menu |

This queue is for tickets about the Tcl-pTk CPAN distribution.

Report information
The Basics
Id: 125662
Status: new
Priority: 0/
Queue: Tcl-pTk

People
Owner: Nobody in particular
Requestors: CAC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.92
Fixed in: (no value)



Subject: fileevent not working on macOS
On macOS (10.13), the call to ioctl() from Tcl::pTk::Widget::_FE_helper returns undef (i.e. the OS ioctl returns -1), and $! (errno) is set to "Inappropriate ioctl for device".

Because of this, all tests fail for both t/fileevent.t and t/fileevent2.t.

fileevent seems to work fine on Windows and Linux though. I did notice in the comments that there were other ideas for improving/reimplementing fileevent at some point. One thing that would be nice is to not rely on a (large) polling interval, since it leads to a somewhat "jerky" appearance in certain applications (such as the serial terminal in the program I'm working on). 

Note: h2ph also needs to be run for fileevent to work at all on macOS. I had followed instructions from a MacPorts ticket (it looks like it would apply systemwide, but I've only tried them from MacPorts' perl; it also requires Xcode command line tools):

cd /usr/include; h2ph -r -l .

I would think only sys/ioctl.ph needs to be generated though.
Subject: [macOS, FreeBSD] fileevent not working
It turns out this issue also affects FreeBSD, which makes sense because its sys/ioctl.h is something macOS (Darwin) also inherited from BSD.

I had posted to the mailing list a few months ago asking about fileevent support for Tcl.pm. Other than talking about a few workaround or approaches, a solution hasn't been planned yet. I am under the impression that using Tcl_CreateFileHandler from Tcl.xs might be the closest thing needed for emulating fileevent, however I'm not familiar with XS nor the Tcl C API, so I may seek assistance implementing this. If and when that is done, the partial solution from Tcl::pTk might be removed (although it works on Windows, whereas Tcl_CreateFileHandler will not). Unless there is still another better way I haven't thought of…

In the meantime I have made the fileevent tests TODO on BSD platforms, see 250c0db and bc143bd