Calling this a protocol is perhaps a bit of a stretch. The following basic
components are used in comminucation between mood and its clients:

- To send a command, the client may send a command_t structure, with its
  type field set to the command_* value of the command to run, and its len
  and argc fields filled in. This must be followed by len bytes of data
  being sent by the client. This is the arguments for the command, with
  each argument separated by '\0'. The arguments vary per command, and
  are not always identical to the arguments used in syscalls. See the
  comments in proxy.h for details.
- To send a fd, the client should sendmsg once, passing a fd through the
  socket.
- Mood may at any time send back a result_t structure.

Now, to ask mood to exec a method, send to the main socket:

- A fd open to the directory of the object that the method will run on.
- Then send the exec command.
- Then send stdin, stdout, and stderr through the socket as three separate
  fd sends.

If the exec fails, the result structure will have its err field set to the
errno. Otherwise, the ret field will contain the status code that mood got
when it waitpid()'d for the command to exit. So, WEXITSTATUS(ret) can be
used to get the exit status.

To ask mood to signal all running methods of an object, send to the main
socket:

- A fd open to the directory of the object that the method will run on.
- The kill command.

And receive a result.

To ask mood to run any other proxied syscall, the client must connect to
the child of mood that was reposonible for running them, which does the
operation as a proxy. MOOSOCK is set in the environment of each method to
the socket they can connect to. Access is controlled strictly by filesystem
permissions on the sockets. Send a command to the socket, read back a
result structure.

Note that commands that operate on files (exec the execv command) require
that the file to be acted on be the output of 'basename' on the full
filename; eg, that it not include any slashes. This is done to prevent a
possible (but rather unlikely) race.

Some some commands may return additional information, such as fd's after
this result_t. For example, command_open will pass a fd back.
