if (fptr.wbuf.len != 0) {
runtime.getWarnings().warn("syswrite for buffered IO");
}
ByteList strByteList = ((RubyString) str).getByteList();
n = OpenFile.writeInternal(context, fptr, fptr.fd(), strByteList.unsafeBytes(), strByteList.begin(), strByteList.getRealSize());
if (n == -1) throw runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath());
} finally {
if (locked) fptr.unlock();
}