comparison src/process.c @ 100860:0d09a43201b6

(Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess) (Qttname, Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime) (Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs) (Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtpgid, Qcstime) [!subprocesses]: Define. (syms_of_process) [!subprocesses]: Intern and staticpro them. (Flist_system_processes, Fsystem_process_attributes) [!subprocesses]: Call list_system_processes and system_process_attributes instead of returning Qnil.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 03 Jan 2009 15:03:59 +0000
parents 0b30d1767fab
children dd95cb42c0aa
comparison
equal deleted inserted replaced
100859:bb7058ae1991 100860:0d09a43201b6
1 /* Asynchronous subprocess control for GNU Emacs. 1 /* Asynchronous subprocess control for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
3 1996, 1998, 1999, 2001, 2002, 2003, 2004, 3 1996, 1998, 1999, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 4 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 5
6 This file is part of GNU Emacs. 6 This file is part of GNU Emacs.
7 7
8 GNU Emacs is free software: you can redistribute it and/or modify 8 GNU Emacs is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
7539 extern EMACS_TIME timer_check (); 7539 extern EMACS_TIME timer_check ();
7540 extern int timers_run; 7540 extern int timers_run;
7541 7541
7542 Lisp_Object QCtype, QCname; 7542 Lisp_Object QCtype, QCname;
7543 7543
7544 Lisp_Object Qeuid, Qegid, Qcomm, Qstate, Qppid, Qpgrp, Qsess, Qttname, Qtpgid;
7545 Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime, Qcstime;
7546 Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs;
7547 Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime;
7548
7544 /* As described above, except assuming that there are no subprocesses: 7549 /* As described above, except assuming that there are no subprocesses:
7545 7550
7546 Wait for timeout to elapse and/or keyboard input to be available. 7551 Wait for timeout to elapse and/or keyboard input to be available.
7547 7552
7548 time_limit is: 7553 time_limit is:
7808 7813
7809 See `system-process-attributes' for getting attributes of a process 7814 See `system-process-attributes' for getting attributes of a process
7810 given its ID. */) 7815 given its ID. */)
7811 () 7816 ()
7812 { 7817 {
7813 return Qnil; 7818 return list_system_processes ();
7814 } 7819 }
7815 7820
7816 DEFUN ("system-process-attributes", Fsystem_process_attributes, 7821 DEFUN ("system-process-attributes", Fsystem_process_attributes,
7817 Ssystem_process_attributes, 1, 1, 0, 7822 Ssystem_process_attributes, 1, 1, 0,
7818 doc: /* Return attributes of the process given by its PID, a number. 7823 doc: /* Return attributes of the process given by its PID, a number.
7866 args -- command line which invoked the process (string). */) 7871 args -- command line which invoked the process (string). */)
7867 (pid) 7872 (pid)
7868 7873
7869 Lisp_Object pid; 7874 Lisp_Object pid;
7870 { 7875 {
7871 return Qnil; 7876 return system_process_attributes (pid);
7872 } 7877 }
7873 7878
7874 void 7879 void
7875 init_process () 7880 init_process ()
7876 { 7881 {
7881 { 7886 {
7882 QCtype = intern (":type"); 7887 QCtype = intern (":type");
7883 staticpro (&QCtype); 7888 staticpro (&QCtype);
7884 QCname = intern (":name"); 7889 QCname = intern (":name");
7885 staticpro (&QCname); 7890 staticpro (&QCname);
7891 QCtype = intern (":type");
7892 staticpro (&QCtype);
7893 QCname = intern (":name");
7894 staticpro (&QCname);
7895 Qeuid = intern ("euid");
7896 staticpro (&Qeuid);
7897 Qegid = intern ("egid");
7898 staticpro (&Qegid);
7899 Quser = intern ("user");
7900 staticpro (&Quser);
7901 Qgroup = intern ("group");
7902 staticpro (&Qgroup);
7903 Qcomm = intern ("comm");
7904 staticpro (&Qcomm);
7905 Qstate = intern ("state");
7906 staticpro (&Qstate);
7907 Qppid = intern ("ppid");
7908 staticpro (&Qppid);
7909 Qpgrp = intern ("pgrp");
7910 staticpro (&Qpgrp);
7911 Qsess = intern ("sess");
7912 staticpro (&Qsess);
7913 Qttname = intern ("ttname");
7914 staticpro (&Qttname);
7915 Qtpgid = intern ("tpgid");
7916 staticpro (&Qtpgid);
7917 Qminflt = intern ("minflt");
7918 staticpro (&Qminflt);
7919 Qmajflt = intern ("majflt");
7920 staticpro (&Qmajflt);
7921 Qcminflt = intern ("cminflt");
7922 staticpro (&Qcminflt);
7923 Qcmajflt = intern ("cmajflt");
7924 staticpro (&Qcmajflt);
7925 Qutime = intern ("utime");
7926 staticpro (&Qutime);
7927 Qstime = intern ("stime");
7928 staticpro (&Qstime);
7929 Qtime = intern ("time");
7930 staticpro (&Qtime);
7931 Qcutime = intern ("cutime");
7932 staticpro (&Qcutime);
7933 Qcstime = intern ("cstime");
7934 staticpro (&Qcstime);
7935 Qctime = intern ("ctime");
7936 staticpro (&Qctime);
7937 Qpri = intern ("pri");
7938 staticpro (&Qpri);
7939 Qnice = intern ("nice");
7940 staticpro (&Qnice);
7941 Qthcount = intern ("thcount");
7942 staticpro (&Qthcount);
7943 Qstart = intern ("start");
7944 staticpro (&Qstart);
7945 Qvsize = intern ("vsize");
7946 staticpro (&Qvsize);
7947 Qrss = intern ("rss");
7948 staticpro (&Qrss);
7949 Qetime = intern ("etime");
7950 staticpro (&Qetime);
7951 Qpcpu = intern ("pcpu");
7952 staticpro (&Qpcpu);
7953 Qpmem = intern ("pmem");
7954 staticpro (&Qpmem);
7955 Qargs = intern ("args");
7956 staticpro (&Qargs);
7886 7957
7887 defsubr (&Sget_buffer_process); 7958 defsubr (&Sget_buffer_process);
7888 defsubr (&Sprocess_inherit_coding_system_flag); 7959 defsubr (&Sprocess_inherit_coding_system_flag);
7889 defsubr (&Slist_system_processes); 7960 defsubr (&Slist_system_processes);
7890 defsubr (&Ssystem_process_attributes); 7961 defsubr (&Ssystem_process_attributes);