aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 5760d0224eb..6ef3d88c5c8 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -292,10 +292,6 @@ init_baud_rate (int fd)
292int wait_debugging; /* Set nonzero to make following function work under dbx 292int wait_debugging; /* Set nonzero to make following function work under dbx
293 (at least for bsd). */ 293 (at least for bsd). */
294 294
295SIGTYPE
296wait_for_termination_signal (void)
297{}
298
299#ifndef MSDOS 295#ifndef MSDOS
300/* Wait for subprocess with process id `pid' to terminate and 296/* Wait for subprocess with process id `pid' to terminate and
301 make sure it will get eliminated (not remain forever as a zombie) */ 297 make sure it will get eliminated (not remain forever as a zombie) */
@@ -492,7 +488,7 @@ sys_subshell (void)
492 int pid; 488 int pid;
493 struct save_signal saved_handlers[5]; 489 struct save_signal saved_handlers[5];
494 Lisp_Object dir; 490 Lisp_Object dir;
495 unsigned char *str = 0; 491 unsigned char * IF_LINT (volatile) str = 0;
496 int len; 492 int len;
497 493
498 saved_handlers[0].code = SIGINT; 494 saved_handlers[0].code = SIGINT;
@@ -632,7 +628,7 @@ init_sigio (int fd)
632{ 628{
633} 629}
634 630
635void 631static void
636reset_sigio (int fd) 632reset_sigio (int fd)
637{ 633{
638} 634}
@@ -662,7 +658,7 @@ init_sigio (int fd)
662 interrupts_deferred = 0; 658 interrupts_deferred = 0;
663} 659}
664 660
665void 661static void
666reset_sigio (int fd) 662reset_sigio (int fd)
667{ 663{
668#ifdef FASYNC 664#ifdef FASYNC
@@ -1890,13 +1886,13 @@ emacs_write (int fildes, const char *buf, unsigned int nbyte)
1890 * under error conditions. 1886 * under error conditions.
1891 */ 1887 */
1892 1888
1889#ifndef HAVE_GETWD
1890
1893#ifndef MAXPATHLEN 1891#ifndef MAXPATHLEN
1894/* In 4.1, param.h fails to define this. */ 1892/* In 4.1, param.h fails to define this. */
1895#define MAXPATHLEN 1024 1893#define MAXPATHLEN 1024
1896#endif 1894#endif
1897 1895
1898#ifndef HAVE_GETWD
1899
1900char * 1896char *
1901getwd (char *pathname) 1897getwd (char *pathname)
1902{ 1898{
@@ -2671,8 +2667,8 @@ system_process_attributes (Lisp_Object pid)
2671 size_t cmdsize = 0, cmdline_size; 2667 size_t cmdsize = 0, cmdline_size;
2672 unsigned char c; 2668 unsigned char c;
2673 int proc_id, ppid, uid, gid, pgrp, sess, tty, tpgid, thcount; 2669 int proc_id, ppid, uid, gid, pgrp, sess, tty, tpgid, thcount;
2674 unsigned long long utime, stime, cutime, cstime, start; 2670 unsigned long long u_time, s_time, cutime, cstime, start;
2675 long priority, nice, rss; 2671 long priority, niceness, rss;
2676 unsigned long minflt, majflt, cminflt, cmajflt, vsize; 2672 unsigned long minflt, majflt, cminflt, cmajflt, vsize;
2677 time_t sec; 2673 time_t sec;
2678 unsigned usec; 2674 unsigned usec;
@@ -2752,8 +2748,8 @@ system_process_attributes (Lisp_Object pid)
2752 sscanf (p, "%c %d %d %d %d %d %*u %lu %lu %lu %lu %Lu %Lu %Lu %Lu %ld %ld %d %*d %Lu %lu %ld", 2748 sscanf (p, "%c %d %d %d %d %d %*u %lu %lu %lu %lu %Lu %Lu %Lu %Lu %ld %ld %d %*d %Lu %lu %ld",
2753 &c, &ppid, &pgrp, &sess, &tty, &tpgid, 2749 &c, &ppid, &pgrp, &sess, &tty, &tpgid,
2754 &minflt, &cminflt, &majflt, &cmajflt, 2750 &minflt, &cminflt, &majflt, &cmajflt,
2755 &utime, &stime, &cutime, &cstime, 2751 &u_time, &s_time, &cutime, &cstime,
2756 &priority, &nice, &thcount, &start, &vsize, &rss); 2752 &priority, &niceness, &thcount, &start, &vsize, &rss);
2757 { 2753 {
2758 char state_str[2]; 2754 char state_str[2];
2759 2755
@@ -2781,13 +2777,14 @@ system_process_attributes (Lisp_Object pid)
2781 if (clocks_per_sec < 0) 2777 if (clocks_per_sec < 0)
2782 clocks_per_sec = 100; 2778 clocks_per_sec = 100;
2783 attrs = Fcons (Fcons (Qutime, 2779 attrs = Fcons (Fcons (Qutime,
2784 ltime_from_jiffies (utime, clocks_per_sec)), 2780 ltime_from_jiffies (u_time, clocks_per_sec)),
2785 attrs); 2781 attrs);
2786 attrs = Fcons (Fcons (Qstime, 2782 attrs = Fcons (Fcons (Qstime,
2787 ltime_from_jiffies (stime, clocks_per_sec)), 2783 ltime_from_jiffies (s_time, clocks_per_sec)),
2788 attrs); 2784 attrs);
2789 attrs = Fcons (Fcons (Qtime, 2785 attrs = Fcons (Fcons (Qtime,
2790 ltime_from_jiffies (stime+utime, clocks_per_sec)), 2786 ltime_from_jiffies (s_time + u_time,
2787 clocks_per_sec)),
2791 attrs); 2788 attrs);
2792 attrs = Fcons (Fcons (Qcutime, 2789 attrs = Fcons (Fcons (Qcutime,
2793 ltime_from_jiffies (cutime, clocks_per_sec)), 2790 ltime_from_jiffies (cutime, clocks_per_sec)),
@@ -2799,7 +2796,7 @@ system_process_attributes (Lisp_Object pid)
2799 ltime_from_jiffies (cstime+cutime, clocks_per_sec)), 2796 ltime_from_jiffies (cstime+cutime, clocks_per_sec)),
2800 attrs); 2797 attrs);
2801 attrs = Fcons (Fcons (Qpri, make_number (priority)), attrs); 2798 attrs = Fcons (Fcons (Qpri, make_number (priority)), attrs);
2802 attrs = Fcons (Fcons (Qnice, make_number (nice)), attrs); 2799 attrs = Fcons (Fcons (Qnice, make_number (niceness)), attrs);
2803 attrs = Fcons (Fcons (Qthcount, make_fixnum_or_float (thcount_eint)), attrs); 2800 attrs = Fcons (Fcons (Qthcount, make_fixnum_or_float (thcount_eint)), attrs);
2804 EMACS_GET_TIME (tnow); 2801 EMACS_GET_TIME (tnow);
2805 get_up_time (&sec, &usec); 2802 get_up_time (&sec, &usec);
@@ -2829,7 +2826,7 @@ system_process_attributes (Lisp_Object pid)
2829 make_number 2826 make_number
2830 (EMACS_USECS (telapsed)))), 2827 (EMACS_USECS (telapsed)))),
2831 attrs); 2828 attrs);
2832 time_from_jiffies (utime + stime, clocks_per_sec, &sec, &usec); 2829 time_from_jiffies (u_time + s_time, clocks_per_sec, &sec, &usec);
2833 pcpu = (sec + usec / 1000000.0) / (EMACS_SECS (telapsed) + EMACS_USECS (telapsed) / 1000000.0); 2830 pcpu = (sec + usec / 1000000.0) / (EMACS_SECS (telapsed) + EMACS_USECS (telapsed) / 1000000.0);
2834 if (pcpu > 1.0) 2831 if (pcpu > 1.0)
2835 pcpu = 1.0; 2832 pcpu = 1.0;
@@ -2848,8 +2845,10 @@ system_process_attributes (Lisp_Object pid)
2848 fd = emacs_open (fn, O_RDONLY, 0); 2845 fd = emacs_open (fn, O_RDONLY, 0);
2849 if (fd >= 0) 2846 if (fd >= 0)
2850 { 2847 {
2851 for (cmdline_size = 0; emacs_read (fd, &c, 1) == 1; cmdline_size++) 2848 char ch;
2849 for (cmdline_size = 0; emacs_read (fd, &ch, 1) == 1; cmdline_size++)
2852 { 2850 {
2851 c = ch;
2853 if (isspace (c) || c == '\\') 2852 if (isspace (c) || c == '\\')
2854 cmdline_size++; /* for later quoting, see below */ 2853 cmdline_size++; /* for later quoting, see below */
2855 } 2854 }