class IO
def close_on_exec!
def close_on_exec! self.close_on_exec = true end
def close_on_exec!
def close_on_exec! fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) end
def close_on_exec!
def close_on_exec! end
def writev(components)
and whatever else is necessary.
data is written before returning, by performing multiple writev() calls
Unlike the raw writev() system call, this method ensures that all given
way to perform zero-copy I/O.
in order to send the data in a single system call. Thus, #writev is a great
does not require one to concatenate all those strings into a single buffer
descriptor using the +writev()+ system call. Unlike IO#write, this method
Writes all of the strings in the +components+ array into the given file
def writev(components) return PhusionPassenger::NativeSupport.writev(fileno, components) end
def writev(components)
def writev(components) return write(components.join('')) end
def writev2(components, components2)
Like #writev, but accepts two arrays. The data is written in the given order.
def writev2(components, components2) return PhusionPassenger::NativeSupport.writev2(fileno, components, components2) end
def writev2(components, components2)
def writev2(components, components2) data = '' components.each do |component| data << component end components2.each do |component| data << component end return write(data) end
def writev3(components, components2, components3)
["another ", "message\n"],
io.writev3(["hello ", "world", "\n"],
Like #writev, but accepts three arrays. The data is written in the given order.
def writev3(components, components2, components3) return PhusionPassenger::NativeSupport.writev3(fileno, components, components2, components3) end
def writev3(components, components2, components3)
def writev3(components, components2, components3) data = '' components.each do |component| data << component end components2.each do |component| data << component end components3.each do |component| data << component end return write(data) end