             var packets = i2c_rdwr_ioctl_data(msgs: &messages, nmsgs: UInt32(messages.count))
             let status = ioctl(i2c, UInt(I2C_RDWR), &packets)
             guard status >= 0 else {
-                throw I2CError.readOrWriteError(status)
+                throw I2CError.readOrWriteError(status, errno)
             }
             
             if let buf = readBuf {

            }
            let status = ioctl(i2c, UInt(I2C_SLAVE), CInt(newAddress))
            guard status == 0 else {
                throw I2CError.slaveAddressSetError(status)
            }
            self.currentAddress = newAddress
        }

                
                let response = i2c_smbus_write_quick(i2c, UInt8(I2C_SMBUS_WRITE))
                if response < 0 {
                    throw I2CError.noAckError(response, errno)
                }
                return []
            }
