The Perl Ioctl module provides an easily extensible way of getting the value of the C ioctl constants.