Add newline at end of malformed format error.
Add ioctl for osx.