def cmdline(pid):
    """cmdline(pid) -> str list

    Args:
      pid (int): PID of the process.

    Returns:
      A list of the fields in ``/proc/<pid>/cmdline``.
"""
    with open('/proc/%d/cmdline' % pid, 'r') as fd:
        return fd.read().rstrip('\x00').split('\x00')