Mercurial > hg > xemacs-beta
comparison src/sysdep.c @ 535:c69610198c35
[xemacs-hg @ 2001-05-14 04:52:02 by martinb]
Eliminate the need to define HAVE_PTYS in s&m files.
author | martinb |
---|---|
date | Mon, 14 May 2001 04:52:49 +0000 |
parents | e159a0b4bed4 |
children | 666d73d6ac56 |
comparison
equal
deleted
inserted
replaced
534:a0266879cecf | 535:c69610198c35 |
---|---|
186 as well as the O_NDELAY, but that it fails without this. */ | 186 as well as the O_NDELAY, but that it fails without this. */ |
187 /* For AIX: Apparently need this for non-blocking reads on sockets. | 187 /* For AIX: Apparently need this for non-blocking reads on sockets. |
188 It seems that O_NONBLOCK applies only to FIFOs? From | 188 It seems that O_NONBLOCK applies only to FIFOs? From |
189 lowry@watson.ibm.com (Andy Lowry). */ | 189 lowry@watson.ibm.com (Andy Lowry). */ |
190 /* #### Should this be conditionalized on FIONBIO? */ | 190 /* #### Should this be conditionalized on FIONBIO? */ |
191 #if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS)) || defined (AIX) | 191 #if defined (STRIDE) || defined (pfa) || defined (AIX) |
192 { | 192 { |
193 int one = 1; | 193 int one = 1; |
194 ioctl (fd, FIONBIO, &one); | 194 ioctl (fd, FIONBIO, &one); |
195 } | 195 } |
196 #endif | 196 #endif |
887 #else | 887 #else |
888 return -1; | 888 return -1; |
889 #endif | 889 #endif |
890 } | 890 } |
891 | 891 |
892 #ifdef HAVE_PTYS | |
893 | |
894 /* Set up the proper status flags for use of a pty. */ | 892 /* Set up the proper status flags for use of a pty. */ |
895 | 893 |
896 void | 894 void |
897 setup_pty (int fd) | 895 setup_pty (int fd) |
898 { | 896 { |
899 /* I'm told that TIOCREMOTE does not mean control chars | |
900 "can't be sent" but rather that they don't have | |
901 input-editing or signaling effects. | |
902 That should be good, because we have other ways | |
903 to do those things in Emacs. | |
904 However, telnet mode seems not to work on 4.2. | |
905 So TIOCREMOTE is turned off now. */ | |
906 | |
907 /* Under hp-ux, if TIOCREMOTE is turned on, some calls | |
908 will hang. In particular, the "timeout" feature (which | |
909 causes a read to return if there is no data available) | |
910 does this. Also it is known that telnet mode will hang | |
911 in such a way that Emacs must be stopped (perhaps this | |
912 is the same problem). | |
913 | |
914 If TIOCREMOTE is turned off, then there is a bug in | |
915 hp-ux which sometimes loses data. Apparently the | |
916 code which blocks the master process when the internal | |
917 buffer fills up does not work. Other than this, | |
918 though, everything else seems to work fine. | |
919 | |
920 Since the latter lossage is more benign, we may as well | |
921 lose that way. -- cph */ | |
922 #if defined (FIONBIO) && defined (SYSV_PTYS) | |
923 { | |
924 int on = 1; | |
925 ioctl (fd, FIONBIO, &on); | |
926 } | |
927 #endif | |
928 #ifdef IBMRTAIX | 897 #ifdef IBMRTAIX |
929 /* On AIX, the parent gets SIGHUP when a pty attached child dies. So, we */ | 898 /* On AIX, the parent gets SIGHUP when a pty attached child dies. So, we */ |
930 /* ignore SIGHUP once we've started a child on a pty. Note that this may */ | 899 /* ignore SIGHUP once we've started a child on a pty. Note that this may */ |
931 /* cause EMACS not to die when it should, i.e., when its own controlling */ | 900 /* cause EMACS not to die when it should, i.e., when its own controlling */ |
932 /* tty goes away. I've complained to the AIX developers, and they may */ | 901 /* tty goes away. I've complained to the AIX developers, and they may */ |
933 /* change this behavior, but I'm not going to hold my breath. */ | 902 /* change this behavior, but I'm not going to hold my breath. */ |
934 signal (SIGHUP, SIG_IGN); | 903 signal (SIGHUP, SIG_IGN); |
935 #endif | 904 #endif /* IBMRTAIX */ |
905 | |
936 #ifdef TIOCPKT | 906 #ifdef TIOCPKT |
937 /* In some systems (Linux through 2.0.0, at least), packet mode doesn't | 907 /* In some systems (Linux through 2.0.0, at least), packet mode doesn't |
938 get cleared when a pty is closed, so we need to clear it here. | 908 get cleared when a pty is closed, so we need to clear it here. |
939 Linux pre2.0.13 contained an attempted fix for this (from Ted Ts'o, | 909 Linux pre2.0.13 contained an attempted fix for this (from Ted Ts'o, |
940 tytso@mit.edu), but apparently it messed up rlogind and telnetd, so he | 910 tytso@mit.edu), but apparently it messed up rlogind and telnetd, so he |
942 */ | 912 */ |
943 { | 913 { |
944 int off = 0; | 914 int off = 0; |
945 ioctl (fd, TIOCPKT, (char *)&off); | 915 ioctl (fd, TIOCPKT, (char *)&off); |
946 } | 916 } |
947 #endif | 917 #endif /* TIOCPKT */ |
948 } | 918 } |
949 #endif /* HAVE_PTYS */ | |
950 | 919 |
951 | 920 |
952 /************************************************************************/ | 921 /************************************************************************/ |
953 /* TTY control */ | 922 /* TTY control */ |
954 /************************************************************************/ | 923 /************************************************************************/ |