Set the host name of the machine.

def sethostname(name):
    """Set the host name of the machine."""
    # TODO: replace with socket.sethostname, which is available from Python 3.3
    name = name.encode()
    _libc.sethostname(name, len(name))