diff options
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 94 |
1 files changed, 32 insertions, 62 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index a026cd014a2..60da786c04d 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -254,7 +254,7 @@ get_current_dir_name () | |||
| 254 | /* Discard pending input on all input descriptors. */ | 254 | /* Discard pending input on all input descriptors. */ |
| 255 | 255 | ||
| 256 | void | 256 | void |
| 257 | discard_tty_input () | 257 | discard_tty_input (void) |
| 258 | { | 258 | { |
| 259 | #ifndef WINDOWSNT | 259 | #ifndef WINDOWSNT |
| 260 | struct emacs_tty buf; | 260 | struct emacs_tty buf; |
| @@ -353,8 +353,7 @@ init_baud_rate (int fd) | |||
| 353 | 353 | ||
| 354 | /*ARGSUSED*/ | 354 | /*ARGSUSED*/ |
| 355 | void | 355 | void |
| 356 | set_exclusive_use (fd) | 356 | set_exclusive_use (int fd) |
| 357 | int fd; | ||
| 358 | { | 357 | { |
| 359 | #ifdef FIOCLEX | 358 | #ifdef FIOCLEX |
| 360 | ioctl (fd, FIOCLEX, 0); | 359 | ioctl (fd, FIOCLEX, 0); |
| @@ -376,15 +375,14 @@ int wait_debugging; /* Set nonzero to make following function work under dbx | |||
| 376 | (at least for bsd). */ | 375 | (at least for bsd). */ |
| 377 | 376 | ||
| 378 | SIGTYPE | 377 | SIGTYPE |
| 379 | wait_for_termination_signal () | 378 | wait_for_termination_signal (void) |
| 380 | {} | 379 | {} |
| 381 | 380 | ||
| 382 | /* Wait for subprocess with process id `pid' to terminate and | 381 | /* Wait for subprocess with process id `pid' to terminate and |
| 383 | make sure it will get eliminated (not remain forever as a zombie) */ | 382 | make sure it will get eliminated (not remain forever as a zombie) */ |
| 384 | 383 | ||
| 385 | void | 384 | void |
| 386 | wait_for_termination (pid) | 385 | wait_for_termination (int pid) |
| 387 | int pid; | ||
| 388 | { | 386 | { |
| 389 | while (1) | 387 | while (1) |
| 390 | { | 388 | { |
| @@ -438,8 +436,7 @@ wait_for_termination (pid) | |||
| 438 | */ | 436 | */ |
| 439 | 437 | ||
| 440 | void | 438 | void |
| 441 | flush_pending_output (channel) | 439 | flush_pending_output (int channel) |
| 442 | int channel; | ||
| 443 | { | 440 | { |
| 444 | #ifdef HAVE_TERMIOS | 441 | #ifdef HAVE_TERMIOS |
| 445 | /* If we try this, we get hit with SIGTTIN, because | 442 | /* If we try this, we get hit with SIGTTIN, because |
| @@ -465,8 +462,7 @@ flush_pending_output (channel) | |||
| 465 | in Emacs. No padding needed for insertion into an Emacs buffer. */ | 462 | in Emacs. No padding needed for insertion into an Emacs buffer. */ |
| 466 | 463 | ||
| 467 | void | 464 | void |
| 468 | child_setup_tty (out) | 465 | child_setup_tty (int out) |
| 469 | int out; | ||
| 470 | { | 466 | { |
| 471 | #ifndef DOS_NT | 467 | #ifndef DOS_NT |
| 472 | struct emacs_tty s; | 468 | struct emacs_tty s; |
| @@ -570,7 +566,7 @@ static void restore_signal_handlers (struct save_signal *); | |||
| 570 | /* Suspend the Emacs process; give terminal to its superior. */ | 566 | /* Suspend the Emacs process; give terminal to its superior. */ |
| 571 | 567 | ||
| 572 | void | 568 | void |
| 573 | sys_suspend () | 569 | sys_suspend (void) |
| 574 | { | 570 | { |
| 575 | #if defined (SIGTSTP) && !defined (MSDOS) | 571 | #if defined (SIGTSTP) && !defined (MSDOS) |
| 576 | 572 | ||
| @@ -591,7 +587,7 @@ sys_suspend () | |||
| 591 | /* Fork a subshell. */ | 587 | /* Fork a subshell. */ |
| 592 | 588 | ||
| 593 | void | 589 | void |
| 594 | sys_subshell () | 590 | sys_subshell (void) |
| 595 | { | 591 | { |
| 596 | #ifdef DOS_NT /* Demacs 1.1.2 91/10/20 Manabu Higashida */ | 592 | #ifdef DOS_NT /* Demacs 1.1.2 91/10/20 Manabu Higashida */ |
| 597 | int st; | 593 | int st; |
| @@ -719,8 +715,7 @@ sys_subshell () | |||
| 719 | } | 715 | } |
| 720 | 716 | ||
| 721 | static void | 717 | static void |
| 722 | save_signal_handlers (saved_handlers) | 718 | save_signal_handlers (struct save_signal *saved_handlers) |
| 723 | struct save_signal *saved_handlers; | ||
| 724 | { | 719 | { |
| 725 | while (saved_handlers->code) | 720 | while (saved_handlers->code) |
| 726 | { | 721 | { |
| @@ -731,8 +726,7 @@ save_signal_handlers (saved_handlers) | |||
| 731 | } | 726 | } |
| 732 | 727 | ||
| 733 | static void | 728 | static void |
| 734 | restore_signal_handlers (saved_handlers) | 729 | restore_signal_handlers (struct save_signal *saved_handlers) |
| 735 | struct save_signal *saved_handlers; | ||
| 736 | { | 730 | { |
| 737 | while (saved_handlers->code) | 731 | while (saved_handlers->code) |
| 738 | { | 732 | { |
| @@ -769,8 +763,7 @@ unrequest_sigio (void) | |||
| 769 | int old_fcntl_flags[MAXDESC]; | 763 | int old_fcntl_flags[MAXDESC]; |
| 770 | 764 | ||
| 771 | void | 765 | void |
| 772 | init_sigio (fd) | 766 | init_sigio (int fd) |
| 773 | int fd; | ||
| 774 | { | 767 | { |
| 775 | #ifdef FASYNC | 768 | #ifdef FASYNC |
| 776 | old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC; | 769 | old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC; |
| @@ -780,8 +773,7 @@ init_sigio (fd) | |||
| 780 | } | 773 | } |
| 781 | 774 | ||
| 782 | void | 775 | void |
| 783 | reset_sigio (fd) | 776 | reset_sigio (int fd) |
| 784 | int fd; | ||
| 785 | { | 777 | { |
| 786 | #ifdef FASYNC | 778 | #ifdef FASYNC |
| 787 | fcntl (fd, F_SETFL, old_fcntl_flags[fd]); | 779 | fcntl (fd, F_SETFL, old_fcntl_flags[fd]); |
| @@ -793,7 +785,7 @@ reset_sigio (fd) | |||
| 793 | /* XXX Yeah, but you need it for SIGIO, don't you? */ | 785 | /* XXX Yeah, but you need it for SIGIO, don't you? */ |
| 794 | 786 | ||
| 795 | void | 787 | void |
| 796 | request_sigio () | 788 | request_sigio (void) |
| 797 | { | 789 | { |
| 798 | if (noninteractive) | 790 | if (noninteractive) |
| 799 | return; | 791 | return; |
| @@ -857,9 +849,7 @@ unrequest_sigio () | |||
| 857 | Return zero if all's well, or -1 if we ran into an error we | 849 | Return zero if all's well, or -1 if we ran into an error we |
| 858 | couldn't deal with. */ | 850 | couldn't deal with. */ |
| 859 | int | 851 | int |
| 860 | emacs_get_tty (fd, settings) | 852 | emacs_get_tty (int fd, struct emacs_tty *settings) |
| 861 | int fd; | ||
| 862 | struct emacs_tty *settings; | ||
| 863 | { | 853 | { |
| 864 | /* Retrieve the primary parameters - baud rate, character size, etcetera. */ | 854 | /* Retrieve the primary parameters - baud rate, character size, etcetera. */ |
| 865 | #ifdef HAVE_TCATTR | 855 | #ifdef HAVE_TCATTR |
| @@ -906,10 +896,7 @@ emacs_get_tty (fd, settings) | |||
| 906 | Return 0 if all went well, and -1 if anything failed. */ | 896 | Return 0 if all went well, and -1 if anything failed. */ |
| 907 | 897 | ||
| 908 | int | 898 | int |
| 909 | emacs_set_tty (fd, settings, flushp) | 899 | emacs_set_tty (int fd, struct emacs_tty *settings, int flushp) |
| 910 | int fd; | ||
| 911 | struct emacs_tty *settings; | ||
| 912 | int flushp; | ||
| 913 | { | 900 | { |
| 914 | /* Set the primary parameters - baud rate, character size, etcetera. */ | 901 | /* Set the primary parameters - baud rate, character size, etcetera. */ |
| 915 | #ifdef HAVE_TCATTR | 902 | #ifdef HAVE_TCATTR |
| @@ -1021,8 +1008,7 @@ init_all_sys_modes (void) | |||
| 1021 | /* Initialize the terminal mode on the given tty device. */ | 1008 | /* Initialize the terminal mode on the given tty device. */ |
| 1022 | 1009 | ||
| 1023 | void | 1010 | void |
| 1024 | init_sys_modes (tty_out) | 1011 | init_sys_modes (struct tty_display_info *tty_out) |
| 1025 | struct tty_display_info *tty_out; | ||
| 1026 | { | 1012 | { |
| 1027 | struct emacs_tty tty; | 1013 | struct emacs_tty tty; |
| 1028 | 1014 | ||
| @@ -1365,8 +1351,7 @@ get_tty_size (int fd, int *widthp, int *heightp) | |||
| 1365 | to HEIGHT and WIDTH. This is used mainly with ptys. */ | 1351 | to HEIGHT and WIDTH. This is used mainly with ptys. */ |
| 1366 | 1352 | ||
| 1367 | int | 1353 | int |
| 1368 | set_window_size (fd, height, width) | 1354 | set_window_size (int fd, int height, int width) |
| 1369 | int fd, height, width; | ||
| 1370 | { | 1355 | { |
| 1371 | #ifdef TIOCSWINSZ | 1356 | #ifdef TIOCSWINSZ |
| 1372 | 1357 | ||
| @@ -1414,8 +1399,7 @@ reset_all_sys_modes (void) | |||
| 1414 | bottom of the frame, turn off interrupt-driven I/O, etc. */ | 1399 | bottom of the frame, turn off interrupt-driven I/O, etc. */ |
| 1415 | 1400 | ||
| 1416 | void | 1401 | void |
| 1417 | reset_sys_modes (tty_out) | 1402 | reset_sys_modes (struct tty_display_info *tty_out) |
| 1418 | struct tty_display_info *tty_out; | ||
| 1419 | { | 1403 | { |
| 1420 | if (noninteractive) | 1404 | if (noninteractive) |
| 1421 | { | 1405 | { |
| @@ -1490,8 +1474,7 @@ reset_sys_modes (tty_out) | |||
| 1490 | /* Set up the proper status flags for use of a pty. */ | 1474 | /* Set up the proper status flags for use of a pty. */ |
| 1491 | 1475 | ||
| 1492 | void | 1476 | void |
| 1493 | setup_pty (fd) | 1477 | setup_pty (int fd) |
| 1494 | int fd; | ||
| 1495 | { | 1478 | { |
| 1496 | /* I'm told that TOICREMOTE does not mean control chars | 1479 | /* I'm told that TOICREMOTE does not mean control chars |
| 1497 | "can't be sent" but rather that they don't have | 1480 | "can't be sent" but rather that they don't have |
| @@ -1540,7 +1523,7 @@ setup_pty (fd) | |||
| 1540 | #if !(defined (__NetBSD__) && defined (__ELF__)) | 1523 | #if !(defined (__NetBSD__) && defined (__ELF__)) |
| 1541 | #ifndef HAVE_TEXT_START | 1524 | #ifndef HAVE_TEXT_START |
| 1542 | char * | 1525 | char * |
| 1543 | start_of_text () | 1526 | start_of_text (void) |
| 1544 | { | 1527 | { |
| 1545 | #ifdef TEXT_START | 1528 | #ifdef TEXT_START |
| 1546 | return ((char *) TEXT_START); | 1529 | return ((char *) TEXT_START); |
| @@ -1580,7 +1563,7 @@ start_of_text () | |||
| 1580 | 1563 | ||
| 1581 | #ifndef start_of_data | 1564 | #ifndef start_of_data |
| 1582 | char * | 1565 | char * |
| 1583 | start_of_data () | 1566 | start_of_data (void) |
| 1584 | { | 1567 | { |
| 1585 | #ifdef DATA_START | 1568 | #ifdef DATA_START |
| 1586 | return ((char *) DATA_START); | 1569 | return ((char *) DATA_START); |
| @@ -1621,7 +1604,7 @@ extern int h_errno; | |||
| 1621 | #endif /* TRY_AGAIN */ | 1604 | #endif /* TRY_AGAIN */ |
| 1622 | 1605 | ||
| 1623 | void | 1606 | void |
| 1624 | init_system_name () | 1607 | init_system_name (void) |
| 1625 | { | 1608 | { |
| 1626 | #ifndef HAVE_GETHOSTNAME | 1609 | #ifndef HAVE_GETHOSTNAME |
| 1627 | struct utsname uts; | 1610 | struct utsname uts; |
| @@ -2077,7 +2060,7 @@ static char *my_sys_siglist[NSIG]; | |||
| 2077 | #endif | 2060 | #endif |
| 2078 | 2061 | ||
| 2079 | void | 2062 | void |
| 2080 | init_signals () | 2063 | init_signals (void) |
| 2081 | { | 2064 | { |
| 2082 | sigemptyset (&empty_mask); | 2065 | sigemptyset (&empty_mask); |
| 2083 | sigfillset (&full_mask); | 2066 | sigfillset (&full_mask); |
| @@ -2283,8 +2266,7 @@ init_signals () | |||
| 2283 | #endif /* !RAND_BITS */ | 2266 | #endif /* !RAND_BITS */ |
| 2284 | 2267 | ||
| 2285 | void | 2268 | void |
| 2286 | seed_random (arg) | 2269 | seed_random (long int arg) |
| 2287 | long arg; | ||
| 2288 | { | 2270 | { |
| 2289 | #ifdef HAVE_RANDOM | 2271 | #ifdef HAVE_RANDOM |
| 2290 | srandom ((unsigned int)arg); | 2272 | srandom ((unsigned int)arg); |
| @@ -2302,7 +2284,7 @@ seed_random (arg) | |||
| 2302 | * This suffices even for a 64-bit architecture with a 15-bit rand. | 2284 | * This suffices even for a 64-bit architecture with a 15-bit rand. |
| 2303 | */ | 2285 | */ |
| 2304 | long | 2286 | long |
| 2305 | get_random () | 2287 | get_random (void) |
| 2306 | { | 2288 | { |
| 2307 | long val = random (); | 2289 | long val = random (); |
| 2308 | #if VALBITS > RAND_BITS | 2290 | #if VALBITS > RAND_BITS |
| @@ -2337,9 +2319,7 @@ strerror (errnum) | |||
| 2337 | #endif /* ! HAVE_STRERROR */ | 2319 | #endif /* ! HAVE_STRERROR */ |
| 2338 | 2320 | ||
| 2339 | int | 2321 | int |
| 2340 | emacs_open (path, oflag, mode) | 2322 | emacs_open (const char *path, int oflag, int mode) |
| 2341 | const char *path; | ||
| 2342 | int oflag, mode; | ||
| 2343 | { | 2323 | { |
| 2344 | register int rtnval; | 2324 | register int rtnval; |
| 2345 | 2325 | ||
| @@ -2350,8 +2330,7 @@ emacs_open (path, oflag, mode) | |||
| 2350 | } | 2330 | } |
| 2351 | 2331 | ||
| 2352 | int | 2332 | int |
| 2353 | emacs_close (fd) | 2333 | emacs_close (int fd) |
| 2354 | int fd; | ||
| 2355 | { | 2334 | { |
| 2356 | int did_retry = 0; | 2335 | int did_retry = 0; |
| 2357 | register int rtnval; | 2336 | register int rtnval; |
| @@ -2370,10 +2349,7 @@ emacs_close (fd) | |||
| 2370 | } | 2349 | } |
| 2371 | 2350 | ||
| 2372 | int | 2351 | int |
| 2373 | emacs_read (fildes, buf, nbyte) | 2352 | emacs_read (int fildes, char *buf, unsigned int nbyte) |
| 2374 | int fildes; | ||
| 2375 | char *buf; | ||
| 2376 | unsigned int nbyte; | ||
| 2377 | { | 2353 | { |
| 2378 | register int rtnval; | 2354 | register int rtnval; |
| 2379 | 2355 | ||
| @@ -2384,10 +2360,7 @@ emacs_read (fildes, buf, nbyte) | |||
| 2384 | } | 2360 | } |
| 2385 | 2361 | ||
| 2386 | int | 2362 | int |
| 2387 | emacs_write (fildes, buf, nbyte) | 2363 | emacs_write (int fildes, const char *buf, unsigned int nbyte) |
| 2388 | int fildes; | ||
| 2389 | const char *buf; | ||
| 2390 | unsigned int nbyte; | ||
| 2391 | { | 2364 | { |
| 2392 | register int rtnval, bytes_written; | 2365 | register int rtnval, bytes_written; |
| 2393 | 2366 | ||
| @@ -2574,8 +2547,7 @@ gettimeofday (tp, tzp) | |||
| 2574 | */ | 2547 | */ |
| 2575 | 2548 | ||
| 2576 | void | 2549 | void |
| 2577 | croak (badfunc) | 2550 | croak (char *badfunc) |
| 2578 | char *badfunc; | ||
| 2579 | { | 2551 | { |
| 2580 | printf ("%s not yet implemented\r\n", badfunc); | 2552 | printf ("%s not yet implemented\r\n", badfunc); |
| 2581 | reset_all_sys_modes (); | 2553 | reset_all_sys_modes (); |
| @@ -2607,9 +2579,7 @@ closedir (DIR *dirp /* stream from opendir */) | |||
| 2607 | 2579 | ||
| 2608 | 2580 | ||
| 2609 | int | 2581 | int |
| 2610 | set_file_times (filename, atime, mtime) | 2582 | set_file_times (const char *filename, struct timeval atime, struct timeval mtime) |
| 2611 | const char *filename; | ||
| 2612 | EMACS_TIME atime, mtime; | ||
| 2613 | { | 2583 | { |
| 2614 | #ifdef HAVE_UTIMES | 2584 | #ifdef HAVE_UTIMES |
| 2615 | struct timeval tv[2]; | 2585 | struct timeval tv[2]; |
| @@ -2993,7 +2963,7 @@ serial_configure (struct Lisp_Process *p, | |||
| 2993 | /* Process enumeration and access via /proc. */ | 2963 | /* Process enumeration and access via /proc. */ |
| 2994 | 2964 | ||
| 2995 | Lisp_Object | 2965 | Lisp_Object |
| 2996 | list_system_processes () | 2966 | list_system_processes (void) |
| 2997 | { | 2967 | { |
| 2998 | Lisp_Object procdir, match, proclist, next; | 2968 | Lisp_Object procdir, match, proclist, next; |
| 2999 | struct gcpro gcpro1, gcpro2; | 2969 | struct gcpro gcpro1, gcpro2; |