Are there any kernel messages associated with this? -17 is EEXIST. We shouldn't be allowing read() to return that, but we definitely shouldn't be returning it silently.