aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c94
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
256void 256void
257discard_tty_input () 257discard_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*/
355void 355void
356set_exclusive_use (fd) 356set_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
378SIGTYPE 377SIGTYPE
379wait_for_termination_signal () 378wait_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
385void 384void
386wait_for_termination (pid) 385wait_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
440void 438void
441flush_pending_output (channel) 439flush_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
467void 464void
468child_setup_tty (out) 465child_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
572void 568void
573sys_suspend () 569sys_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
593void 589void
594sys_subshell () 590sys_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
721static void 717static void
722save_signal_handlers (saved_handlers) 718save_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
733static void 728static void
734restore_signal_handlers (saved_handlers) 729restore_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)
769int old_fcntl_flags[MAXDESC]; 763int old_fcntl_flags[MAXDESC];
770 764
771void 765void
772init_sigio (fd) 766init_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
782void 775void
783reset_sigio (fd) 776reset_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
795void 787void
796request_sigio () 788request_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. */
859int 851int
860emacs_get_tty (fd, settings) 852emacs_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
908int 898int
909emacs_set_tty (fd, settings, flushp) 899emacs_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
1023void 1010void
1024init_sys_modes (tty_out) 1011init_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
1367int 1353int
1368set_window_size (fd, height, width) 1354set_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
1416void 1401void
1417reset_sys_modes (tty_out) 1402reset_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
1492void 1476void
1493setup_pty (fd) 1477setup_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
1542char * 1525char *
1543start_of_text () 1526start_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
1582char * 1565char *
1583start_of_data () 1566start_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
1623void 1606void
1624init_system_name () 1607init_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
2079void 2062void
2080init_signals () 2063init_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
2285void 2268void
2286seed_random (arg) 2269seed_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 */
2304long 2286long
2305get_random () 2287get_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
2339int 2321int
2340emacs_open (path, oflag, mode) 2322emacs_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
2352int 2332int
2353emacs_close (fd) 2333emacs_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
2372int 2351int
2373emacs_read (fildes, buf, nbyte) 2352emacs_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
2386int 2362int
2387emacs_write (fildes, buf, nbyte) 2363emacs_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
2576void 2549void
2577croak (badfunc) 2550croak (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
2609int 2581int
2610set_file_times (filename, atime, mtime) 2582set_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
2995Lisp_Object 2965Lisp_Object
2996list_system_processes () 2966list_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;