http://qs321.pair.com?node_id=11120511


in reply to Re^3: Should I worry about "Inappropriate ioctl for device"? (updated)
in thread Should I worry about "Inappropriate ioctl for device"?

Most likely, errno (the system C variable behind the $! magic) was used uninitialized in both cases. The C runtime library never clears errno and only sets errno to report an error. If no such error has occurred since the program started, the value of errno is undefined, which (in C) means unspecified — it is still an integer, as there is no undef value in C. (NULL pointers are a related but slightly different concept — if you could dereference a NULL pointer, you would logically get undef. In reality, you get SIGSEGV if you dereference a NULL pointer and your program crashes.)