             &val,
             socklen_t(MemoryLayout.size(ofValue: val))
             ) != -1 else {
-                throw IOError(errno: errno, reason: "setsockopt failed")
+                throw IOError(errno: errno, reason: reasonForError(function: "setsockopt"))
         }
     }
     

    public func close() throws {
        let res = sysClose(self.descriptor)
        guard res >= 0 else {
            throw IOError(errno: errno, reason: "close(...) failed")
        }
        self.open = false
    }
}

        let res = fcntl(self.descriptor, F_SETFL, O_NONBLOCK)
        
        guard res >= 0 else {
            throw IOError(errno: errno, reason: reasonForError(function: "fcntl"))
        }
        
    }
