RHEL6: 32-bits compatibility for ioctl BLKSSZGET, returns EINVAL ("Invalid argument") instead of ENOTTY ("Inappropriate ioctl for device")
Issue
On RHEL6, an application compiled for 32-bits on a 64-bit system using the BLKSSZGET ioctl returns an invalid error code when the device argument is a normal file instead of a block device.
On RHEL6, the errno returned is EINVAL == 22 ("Invalid argument") when it should be ENOTTY == 25 ("Inappropriate ioctl for device").
In addition to the invalid errno, a misleading log message is generated.
This problem does not occur on RHEL5 or on RHEL6 in 64-bit mode.
Environment
- Red Hat Enterprise Linux (RHEL) 6
- program compiled for 32-bit on 64-bit system using BLKSSZGET or similar ioctl
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
