comparison src/process.c @ 91041:bdb3fe0ba9fa

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 866-879) - Merge multi-tty branch - Update from CVS - Merge from emacs--rel--22 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
author Miles Bader <miles@gnu.org>
date Thu, 11 Oct 2007 16:22:07 +0000
parents 424b655804ca 143bf32d4d58
children 1251cabc40b7
comparison
equal deleted inserted replaced
91040:14c4a6aac623 91041:bdb3fe0ba9fa
128 #include "window.h" 128 #include "window.h"
129 #include "buffer.h" 129 #include "buffer.h"
130 #include "character.h" 130 #include "character.h"
131 #include "coding.h" 131 #include "coding.h"
132 #include "process.h" 132 #include "process.h"
133 #include "frame.h"
133 #include "termhooks.h" 134 #include "termhooks.h"
134 #include "termopts.h" 135 #include "termopts.h"
135 #include "commands.h" 136 #include "commands.h"
136 #include "keyboard.h" 137 #include "keyboard.h"
137 #include "frame.h"
138 #include "blockinput.h" 138 #include "blockinput.h"
139 #include "dispextern.h" 139 #include "dispextern.h"
140 #include "composite.h" 140 #include "composite.h"
141 #include "atimer.h" 141 #include "atimer.h"
142 142
2718 for a server process, it must be a valid name or address for the local 2718 for a server process, it must be a valid name or address for the local
2719 host, and only clients connecting to that address will be accepted. 2719 host, and only clients connecting to that address will be accepted.
2720 2720
2721 :service SERVICE -- SERVICE is name of the service desired, or an 2721 :service SERVICE -- SERVICE is name of the service desired, or an
2722 integer specifying a port number to connect to. If SERVICE is t, 2722 integer specifying a port number to connect to. If SERVICE is t,
2723 a random port number is selected for the server. 2723 a random port number is selected for the server. (If Emacs was
2724 compiled with getaddrinfo, a port number can also be specified as a
2725 string, e.g. "80", as well as an integer. This is not portable.)
2724 2726
2725 :type TYPE -- TYPE is the type of connection. The default (nil) is a 2727 :type TYPE -- TYPE is the type of connection. The default (nil) is a
2726 stream type connection, `datagram' creates a datagram type connection. 2728 stream type connection, `datagram' creates a datagram type connection.
2727 2729
2728 :family FAMILY -- FAMILY is the address (and protocol) family for the 2730 :family FAMILY -- FAMILY is the address (and protocol) family for the
3154 ai.ai_addr = (struct sockaddr *) &address_in; 3156 ai.ai_addr = (struct sockaddr *) &address_in;
3155 ai.ai_addrlen = sizeof address_in; 3157 ai.ai_addrlen = sizeof address_in;
3156 3158
3157 open_socket: 3159 open_socket:
3158 3160
3161 #ifdef __ultrix__
3162 /* Previously this was compiled unconditionally, but that seems
3163 unnecessary on modern systems, and `unrequest_sigio' was a noop
3164 under X anyway. --lorentey */
3159 /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR) 3165 /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
3160 when connect is interrupted. So let's not let it get interrupted. 3166 when connect is interrupted. So let's not let it get interrupted.
3161 Note we do not turn off polling, because polling is only used 3167 Note we do not turn off polling, because polling is only used
3162 when not interrupt_input, and thus not normally used on the systems 3168 when not interrupt_input, and thus not normally used on the systems
3163 which have this bug. On systems which use polling, there's no way 3169 which have this bug. On systems which use polling, there's no way
3170 thing to do. In any case, I don't see how it could harm to 3176 thing to do. In any case, I don't see how it could harm to
3171 do this -- and it makes cleanup (using unbind_to) easier. */ 3177 do this -- and it makes cleanup (using unbind_to) easier. */
3172 record_unwind_protect (unwind_request_sigio, Qnil); 3178 record_unwind_protect (unwind_request_sigio, Qnil);
3173 unrequest_sigio (); 3179 unrequest_sigio ();
3174 } 3180 }
3181 #endif
3175 3182
3176 /* Do this in case we never enter the for-loop below. */ 3183 /* Do this in case we never enter the for-loop below. */
3177 count1 = SPECPDL_INDEX (); 3184 count1 = SPECPDL_INDEX ();
3178 s = -1; 3185 s = -1;
3179 3186
6860 return (p->filter_multibyte ? Qt : Qnil); 6867 return (p->filter_multibyte ? Qt : Qnil);
6861 } 6868 }
6862 6869
6863 6870
6864 6871
6865 /* The first time this is called, assume keyboard input comes from DESC 6872 /* Add DESC to the set of keyboard input descriptors. */
6866 instead of from where we used to expect it.
6867 Subsequent calls mean assume input keyboard can come from DESC
6868 in addition to other places. */
6869
6870 static int add_keyboard_wait_descriptor_called_flag;
6871 6873
6872 void 6874 void
6873 add_keyboard_wait_descriptor (desc) 6875 add_keyboard_wait_descriptor (desc)
6874 int desc; 6876 int desc;
6875 { 6877 {
6876 if (! add_keyboard_wait_descriptor_called_flag)
6877 FD_CLR (0, &input_wait_mask);
6878 add_keyboard_wait_descriptor_called_flag = 1;
6879 FD_SET (desc, &input_wait_mask); 6878 FD_SET (desc, &input_wait_mask);
6880 FD_SET (desc, &non_process_wait_mask); 6879 FD_SET (desc, &non_process_wait_mask);
6881 if (desc > max_keyboard_desc) 6880 if (desc > max_keyboard_desc)
6882 max_keyboard_desc = desc; 6881 max_keyboard_desc = desc;
6883 } 6882 }
6979 #ifdef ADAPTIVE_READ_BUFFERING 6978 #ifdef ADAPTIVE_READ_BUFFERING
6980 process_output_delay_count = 0; 6979 process_output_delay_count = 0;
6981 process_output_skip = 0; 6980 process_output_skip = 0;
6982 #endif 6981 #endif
6983 6982
6983 /* Don't do this, it caused infinite select loops. The display
6984 method should call add_keyboard_wait_descriptor on stdin if it
6985 needs that. */
6986 #if 0
6984 FD_SET (0, &input_wait_mask); 6987 FD_SET (0, &input_wait_mask);
6988 #endif
6985 6989
6986 Vprocess_alist = Qnil; 6990 Vprocess_alist = Qnil;
6987 #ifdef SIGCHLD 6991 #ifdef SIGCHLD
6988 deleted_pid_list = Qnil; 6992 deleted_pid_list = Qnil;
6989 #endif 6993 #endif