Function: process-status

process-status is a function defined in process.c.

Signature

(process-status PROCESS)

Documentation

Return the status of PROCESS.

The returned value is one of the following symbols:
run -- for a process that is running.
stop -- for a process stopped but continuable. exit -- for a process that has exited. signal -- for a process that has got a fatal signal. open -- for a network stream connection that is open. listen -- for a network stream server that is listening. closed -- for a network stream connection that is closed. connect -- when waiting for a non-blocking connection to complete. failed -- when a non-blocking connection has failed. nil -- if arg is a process name and no such process exists. PROCESS may be a process, a buffer, the name of a process, or nil, indicating the current buffer's process.

Other relevant functions are documented in the process group.

View in manual

Shortdoc

;; process
(process-status process)
    e.g. => exit

Source Code

// Defined in /usr/src/emacs/src/process.c
{
  register struct Lisp_Process *p;
  register Lisp_Object status;

  if (STRINGP (process))
    process = Fget_process (process);
  else
    process = get_process (process);

  if (NILP (process))
    return process;

  p = XPROCESS (process);
  if (p->raw_status_new)
    update_status (p);
  status = p->status;
  if (CONSP (status))
    status = XCAR (status);
  if (NETCONN1_P (p) || SERIALCONN1_P (p) || PIPECONN1_P (p))
    {
      if (EQ (status, Qexit))
	status = Qclosed;
      else if (EQ (p->command, Qt))
	status = Qstop;
      else if (EQ (status, Qrun))
	status = Qopen;
    }
  return status;
}