Changeset 3600 for branches/2.2/src/sysdep.c
- Timestamp:
- 01/23/05 17:06:29 (4 years ago)
- Files:
-
- branches/2.2/src/sysdep.c (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.2/src/sysdep.c
r3598 r3600 1 1 /* Interfaces to system-dependent kernel and library entries. 2 Copyright (C) 1985, 86,87,88,93,94,95, 1999, 2000, 20012 Copyright (C) 1985, 86,87,88,93,94,95,1999,2000,01,2003 3 3 Free Software Foundation, Inc. 4 4 … … 20 20 Boston, MA 02111-1307, USA. */ 21 21 22 23 #include "config.h" 22 #ifdef HAVE_CONFIG_H 23 #include <config.h> 24 #endif 25 24 26 #include <signal.h> 27 #include <stdio.h> 25 28 #include <setjmp.h> 26 29 #ifdef HAVE_UNISTD_H … … 47 50 #undef NULL 48 51 49 #ifdef macintosh52 #ifdef MAC_OS8 50 53 /* It is essential to include stdlib.h so that this file picks up 51 54 the correct definitions of rand, srand, and RAND_MAX. … … 57 60 static int delete_exited_processes; 58 61 #endif 59 #endif /* macintosh*/62 #endif /* MAC_OS8 */ 60 63 61 64 #ifdef WINDOWSNT … … 75 78 #endif 76 79 77 #include <stdio.h>78 80 #include <sys/types.h> 79 81 #include <sys/stat.h> 80 82 #include <errno.h> 81 82 /* Get _POSIX_VDISABLE, if it is available. */83 #ifdef HAVE_UNISTD_H84 #include <unistd.h>85 #endif86 87 #ifdef HAVE_STDLIB_H88 #include <stdlib.h>89 #endif90 83 91 84 #ifdef HAVE_SETPGID … … 146 139 #endif /* not VMS */ 147 140 148 #ifndef BSD4_1 149 #ifdef BSD_SYSTEM /* avoid writing defined (BSD_SYSTEM) || defined (USG) 150 because the vms compiler doesn't grok `defined' */ 141 #ifdef HAVE_FCNTL_H 151 142 #include <fcntl.h> 152 143 #endif 153 #ifdef USG154 #ifndef USG5155 #include <fcntl.h>156 #endif157 #endif158 #endif /* not 4.1 bsd */159 144 160 145 #ifndef MSDOS … … 250 235 #if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T) 251 236 #else 252 #if defined (HAVE_TERMIOS_H) && defined ( LINUX)237 #if defined (HAVE_TERMIOS_H) && defined (GNU_LINUX) 253 238 #include <termios.h> 254 239 #endif … … 330 315 331 316 void 317 #ifdef PROTOTYPES 318 stuff_char (char c) 319 #else 332 320 stuff_char (c) 333 321 char c; 322 #endif 334 323 { 335 324 if (read_socket_hook) … … 481 470 wait (0); 482 471 #else /* neither BSD_SYSTEM nor UNIPLUS: random sysV */ 483 #ifdef POSIX_SIGNALS /* would this work for LINUXas well? */472 #ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ 484 473 sigblock (sigmask (SIGCHLD)); 485 474 errno = 0; … … 766 755 /* Fork a subshell. */ 767 756 768 #ifndef macintosh757 #ifndef MAC_OS8 769 758 void 770 759 sys_subshell () … … 802 791 803 792 dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); 804 str = (unsigned char *) alloca ( XSTRING (dir)->size+ 2);805 len = XSTRING (dir)->size;806 bcopy ( XSTRING (dir)->data, str, len);793 str = (unsigned char *) alloca (SCHARS (dir) + 2); 794 len = SCHARS (dir); 795 bcopy (SDATA (dir), str, len); 807 796 if (str[len - 1] != '/') str[len++] = '/'; 808 797 str[len] = 0; … … 845 834 #ifdef SET_EMACS_PRIORITY 846 835 { 847 extern intemacs_priority;836 extern EMACS_INT emacs_priority; 848 837 849 838 if (emacs_priority < 0) … … 887 876 #endif /* !VMS */ 888 877 } 889 #endif /* ! macintosh*/878 #endif /* !MAC_OS8 */ 890 879 891 880 static void … … 1299 1288 struct emacs_tty tty; 1300 1289 1301 #ifdef macintosh1290 #ifdef MAC_OS8 1302 1291 /* cus-start.el complains if delete-exited-processes is not defined */ 1303 1292 #ifndef subprocesses … … 1307 1296 delete_exited_processes = 0; 1308 1297 #endif 1309 #endif /* not macintosh*/1298 #endif /* MAC_OS8 */ 1310 1299 1311 1300 #ifdef VMS … … 2005 1994 { 2006 1995 struct input_event e; 2007 e.kind = ascii_keystroke; 1996 EVENT_INIT (e); 1997 1998 e.kind = ASCII_KEYSTROKE_EVENT; 2008 1999 XSETINT (e.code, c); 2009 2000 e.frame_or_window = selected_frame; … … 2231 2222 */ 2232 2223 2224 #ifndef start_of_data 2233 2225 char * 2234 2226 start_of_data () … … 2253 2245 #endif /* DATA_START */ 2254 2246 } 2247 #endif /* start_of_data */ 2255 2248 #endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */ 2256 2249 … … 2383 2376 { 2384 2377 char *fqdn = (char *) hp->h_name; 2378 #if 0 2385 2379 char *p; 2380 #endif 2386 2381 2387 2382 if (!index (fqdn, '.')) … … 2457 2452 { 2458 2453 unsigned char *p; 2459 for (p = XSTRING (Vsystem_name)->data; *p; p++)2454 for (p = SDATA (Vsystem_name); *p; p++) 2460 2455 if (*p == ' ' || *p == '\t') 2461 2456 *p = '-'; … … 2642 2637 waiting for at least one character. */ 2643 2638 2644 /* Make all keyboard buffers much bigger when using a window system. */2645 #ifdef HAVE_WINDOW_SYSTEM2646 #define BUFFER_SIZE_FACTOR 162647 #else2648 #define BUFFER_SIZE_FACTOR 12649 #endif2650 2651 2639 void 2652 2640 read_input_waiting () 2653 2641 { 2654 struct input_event e;2655 2642 int nread, i; 2656 2643 extern int quit_char; … … 2672 2659 /* Don't look at input that follows a C-g too closely. 2673 2660 This reduces lossage due to autorepeat on C-g. */ 2674 if (buf[i].kind == ascii_keystroke2661 if (buf[i].kind == ASCII_KEYSTROKE_EVENT 2675 2662 && buf[i].code == quit_char) 2676 2663 break; … … 2679 2666 else 2680 2667 { 2668 struct input_event e; 2681 2669 char buf[3]; 2682 2670 nread = read (fileno (stdin), buf, 1); 2671 EVENT_INIT (e); 2683 2672 2684 2673 /* Scan the chars for C-g and store them in kbd_buffer. */ 2685 e.kind = ascii_keystroke;2674 e.kind = ASCII_KEYSTROKE_EVENT; 2686 2675 e.frame_or_window = selected_frame; 2687 2676 e.modifiers = 0; … … 2866 2855 #endif /* POSIX_SIGNALS */ 2867 2856 2868 #if !defined HAVE_STRSIGNAL && ! defined SYS_SIGLIST_DECLARED2857 #if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST 2869 2858 static char *my_sys_siglist[NSIG]; 2870 2859 # ifdef sys_siglist … … 2882 2871 #endif 2883 2872 2884 #if !defined HAVE_STRSIGNAL && ! defined SYS_SIGLIST_DECLARED2873 #if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST 2885 2874 if (! initialized) 2886 2875 { … … 3042 3031 # endif 3043 3032 } 3044 #endif /* !defined HAVE_STRSIGNAL && !defined SYS_SIGLIST_DECLARED*/3033 #endif /* !defined HAVE_STRSIGNAL && !defined HAVE_DECL_SYS_SIGLIST */ 3045 3034 } 3046 3035 … … 3254 3243 int 3255 3244 emacs_open (path, oflag, mode) 3256 c har *path;3245 const char *path; 3257 3246 int oflag, mode; 3258 3247 { … … 3305 3294 emacs_write (fildes, buf, nbyte) 3306 3295 int fildes; 3307 c har *buf;3296 const char *buf; 3308 3297 unsigned int nbyte; 3309 3298 { … … 3766 3755 } 3767 3756 3768 if (synch_process_death != 0 || synch_process_retcode != 0) 3757 if (synch_process_death != 0 || synch_process_retcode != 0 3758 || synch_process_termsig != 0) 3769 3759 { 3770 3760 errno = EIO; /* We don't know why, but */ … … 3812 3802 } 3813 3803 3814 if (synch_process_death != 0 || synch_process_retcode != 0) 3804 if (synch_process_death != 0 || synch_process_retcode != 0 3805 || synch_process_termsig != 0) 3815 3806 { 3816 3807 errno = EIO; /* We don't know why, but */ … … 5323 5314 #endif /* HAVE_STRSIGNAL */ 5324 5315 5316 /* arch-tag: edb43589-4e09-4544-b325-978b5b121dcf 5317 (do not change this comment) */
