Permalink
Browse files

Be more compatible with OSes that aren't Linux.

Include sys/ioccom.ph on non-Linux OSes. This will work better on
NetBSD 6 and OS X with Fuse4X (which ioctl() is made to work on
them).
  • Loading branch information...
1 parent 183c519 commit 9ae311caa89c6e142903eeb42d2c351663b1ca10 @demonfoo demonfoo committed Apr 8, 2012
Showing with 12 additions and 2 deletions.
  1. +6 −1 examples/fioc.pl
  2. +6 −1 examples/fioclient.pl
View
@@ -27,7 +27,12 @@
use constant FIOC_ROOT => 1;
use constant FIOC_FILE => 2;
-require 'asm/ioctl.ph';
+if ($^O eq 'linux') {
+ require 'linux/ioctl.ph';
+}
+else {
+ require 'sys/ioccom.ph';
+}
our %sizeof = ('size_t' => length(pack('L!')));
sub FIOC_GET_SIZE { _IOR(ord 'E', 0, 'size_t'); }
View
@@ -13,7 +13,12 @@
use Errno qw(:POSIX);
use POSIX;
-require 'asm/ioctl.ph';
+if ($^O eq 'linux') {
+ require 'linux/ioctl.ph';
+}
+else {
+ require 'sys/ioccom.ph';
+}
our %sizeof = ('size_t' => length(pack('L!')));
sub FIOC_GET_SIZE { _IOR(ord 'E', 0, 'size_t'); }

1 comment on commit 9ae311c

Collaborator

demonfoo commented on 9ae311c Apr 9, 2012

That should say "when ioctl() is made to work on them".

Please sign in to comment.