The maximum length of a Unix socket path, including terminating null.
Accept a new client from the given socket.
fileno (integer): The file descriptor of the server socket.
Returns: The accepted client’s file descriptor.
Raises SystemCallError if something went wrong.
static VALUE f_accept(VALUE self, VALUE fileno)
Close all file descriptors, except those given in the exceptions array. For example, the following would close all file descriptors except standard input (0) and standard output (1).
close_all_file_descriptors([0, 1])
static VALUE close_all_file_descriptors(VALUE self, VALUE exceptions)
Create a SOCK_STREAM server Unix socket. Unlike Ruby’s UNIXServer class, this function is also able to create Unix sockets on the abstract namespace by prepending the filename with a null byte.
filename (string): The filename of the Unix socket to create.
backlog (integer): The backlog to use for listening on the socket.
Returns: The file descriptor of the created Unix socket, as an integer.
Raises SystemCallError if something went wrong.
static VALUE create_unix_socket(VALUE self, VALUE filename, VALUE backlog)
Disables any kind of buffering on the C stdout and stderr variables, so that +fprintf()+ on stdout and stderr have immediate effect.
static VALUE disable_stdio_buffering()
Receive a file descriptor from the given Unix socket. Returns the received file descriptor as an integer. Raises SystemCallError if something went wrong.
You do not have call this method directly. A convenience wrapper is provided by IO#recv_io.
static VALUE recv_fd(VALUE self, VALUE socket_fd)
Send a file descriptor over the given Unix socket. You do not have to call this function directly. A convenience wrapper is provided by IO#send_io.
socket_fd (integer): The file descriptor of the socket.
fd_to_send (integer): The file descriptor to send.
Raises SystemCallError if something went wrong.
static VALUE send_fd(VALUE self, VALUE socket_fd, VALUE fd_to_send)
Ruby’s implementations of initgroups, setgid and setuid are broken various ways, sigh... Ruby’s setgid and setuid can’t handle negative UIDs and initgroups is just broken. Work around it by using our own implementation.
static VALUE switch_user(VALUE self, VALUE username, VALUE uid, VALUE gid)
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.