comparison src/sysdep.c @ 1203:bc1acd76b294

* sysdep.c (sys_suspend): Don't try to use "nice (- nice (0))" to set the subshell's priority to normal; nice doesn't return a defined value on all systems. Instead, since emacs_priority gives the priority that Emacs was nastied to, we can use it to reset the priority in a straightforward way. [BSD4_1], [USG], [VMS] (setpriority): Remove dummy and compatibility definitions of setpriority.
author Jim Blandy <jimb@redhat.com>
date Wed, 23 Sep 1992 03:51:13 +0000
parents 5c942f6b2d63
children f9010847a5f5
comparison
equal deleted inserted replaced
1202:3d1bf36f0896 1203:bc1acd76b294
602 } 602 }
603 xyzzy: 603 xyzzy:
604 #ifdef subprocesses 604 #ifdef subprocesses
605 close_process_descs (); /* Close Emacs's pipes/ptys */ 605 close_process_descs (); /* Close Emacs's pipes/ptys */
606 #endif 606 #endif
607 nice (-nice (0)); /* Give the new shell the default piority */ 607
608 #ifdef PRIO_PROCESS
609 {
610 extern int emacs_priority;
611
612 if (emacs_priority)
613 nice (-emacs_priority);
614 }
615 #endif
616
608 execlp (sh, sh, 0); 617 execlp (sh, sh, 0);
609 write (1, "Can't execute subshell", 22); 618 write (1, "Can't execute subshell", 22);
610 _exit (1); 619 _exit (1);
611 } 620 }
612 621
1770 1779
1771 #endif /* not HAVE_SELECT */ 1780 #endif /* not HAVE_SELECT */
1772 #endif /* not VMS */ 1781 #endif /* not VMS */
1773 1782
1774 #ifdef BSD4_1 1783 #ifdef BSD4_1
1775 /* VARARGS */
1776 setpriority ()
1777 {
1778 return 0;
1779 }
1780
1781 /* 1784 /*
1782 * Partially emulate 4.2 open call. 1785 * Partially emulate 4.2 open call.
1783 * open is defined as this in 4.1. 1786 * open is defined as this in 4.1.
1784 * 1787 *
1785 * - added by Michael Bloom @ Citicorp/TTI 1788 * - added by Michael Bloom @ Citicorp/TTI
2366 } 2369 }
2367 return (-1); 2370 return (-1);
2368 } 2371 }
2369 2372
2370 #endif 2373 #endif
2371
2372 /* Set priority value to PRIO. */
2373
2374 int
2375 setpriority (which, who, prio)
2376 int which, who, prio;
2377 {
2378 int nice ();
2379
2380 nice (prio - nice (0));
2381 return (0);
2382 }
2383 2374
2384 #ifndef HAVE_VFORK 2375 #ifndef HAVE_VFORK
2385 2376
2386 /* 2377 /*
2387 * Substitute fork for vfork on USG flavors. 2378 * Substitute fork for vfork on USG flavors.
3779 } 3770 }
3780 3771
3781 ulimit () 3772 ulimit ()
3782 {} 3773 {}
3783 3774
3784 setpriority ()
3785 {}
3786
3787 setpgrp () 3775 setpgrp ()
3788 {} 3776 {}
3789 3777
3790 execvp () 3778 execvp ()
3791 { 3779 {