title: "inappropriate ioctl for device"
body: <p>I have a Perl script running in an AIX box. </p>
  
  <p>The script tries to open a file from a certain directory and it fails to read the file because file has no read permission, but I get a different error saying <code>inappropriate ioctl for device</code>. </p>
  
  <p>Shouldn't it say something like <code>no read permissions for file</code> or something similar?</p>
  
  <p>What does this <code>inappropriate ioctl for device</code> message mean?</p>
  
  <p>How can I fix it?</p>
  
  <p>EDIT: This is what I found when I did <code>strace</code>.</p>
  
  <pre>
  open("/local/logs/xxx/xxxxServer.log", O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 
      0666) = 4 _llseek(4, 0, [77146], SEEK_END) = 0
  ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffc14f8) = -1 ENOTTY 
      (Inappropriate ioctl for  device)
  </pre>