implemented libc ioctl(); *stat,open return proper error codes