diff options
Diffstat (limited to 'src/process.h')
-rw-r--r-- | src/process.h | 65 |
1 files changed, 59 insertions, 6 deletions
diff --git a/src/process.h b/src/process.h index 2e743a3dc38..5ef327aebdc 100644 --- a/src/process.h +++ b/src/process.h @@ -83,7 +83,10 @@ struct Lisp_Process Lisp_Object mark; /* Symbol indicating status of process. - This may be a symbol: run, open, or closed. + This may be a symbol: run, open, closed, listen, or failed. + Or it may be a pair (connect . ADDRINFOS) where ADDRINFOS is + a list of remaining (PROTOCOL . ADDRINFO) pairs to try. + Or it may be (failed ERR) where ERR is an integer, string or symbol. Or it may be a list, whose car is stop, exit or signal and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG) or (SIGNAL_NUMBER . COREDUMP_FLAG). */ @@ -106,18 +109,23 @@ struct Lisp_Process #ifdef HAVE_GNUTLS Lisp_Object gnutls_cred_type; + Lisp_Object gnutls_boot_parameters; #endif /* Pipe process attached to the standard error of this process. */ Lisp_Object stderrproc; + /* The thread a process is linked to, or nil for any thread. */ + Lisp_Object thread; + /* After this point, there are no Lisp_Objects any more. */ /* alloc.c assumes that `pid' is the first such non-Lisp slot. */ - /* Number of this process. - allocate_process assumes this is the first non-Lisp_Object field. - A value 0 is used for pseudo-processes such as network or serial - connections. */ + /* Process ID. A positive value is a child process ID. + Zero is for pseudo-processes such as network or serial connections, + or for processes that have not been fully created yet. + -1 is for a process that was not created successfully. + -2 is for a pty with no process, e.g., for GDB. */ pid_t pid; /* Descriptor by which we read from this process. */ int infd; @@ -161,7 +169,23 @@ struct Lisp_Process flag indicates that `raw_status' contains a new status that still needs to be synced to `status'. */ bool_bf raw_status_new : 1; + /* Whether this is a nonblocking socket. */ + bool_bf is_non_blocking_client : 1; + /* Whether this is a server or a client socket. */ + bool_bf is_server : 1; int raw_status; + /* The length of the socket backlog. */ + int backlog; + /* The port number. */ + int port; + /* The socket type. */ + int socktype; + +#ifdef HAVE_GETADDRINFO_A + /* Whether the socket is waiting for response from an asynchronous + DNS call. */ + struct gaicb *dns_request; +#endif #ifdef HAVE_GNUTLS gnutls_initstage_t gnutls_initstage; @@ -174,9 +198,29 @@ struct Lisp_Process int gnutls_log_level; int gnutls_handshakes_tried; bool_bf gnutls_p : 1; + bool_bf gnutls_complete_negotiation_p : 1; #endif }; +INLINE bool +PROCESSP (Lisp_Object a) +{ + return PSEUDOVECTORP (a, PVEC_PROCESS); +} + +INLINE void +CHECK_PROCESS (Lisp_Object x) +{ + CHECK_TYPE (PROCESSP (x), Qprocessp, x); +} + +INLINE struct Lisp_Process * +XPROCESS (Lisp_Object a) +{ + eassert (PROCESSP (a)); + return XUNTAG (a, Lisp_Vectorlike); +} + /* Every field in the preceding structure except for the first two must be a Lisp_Object, for GC's sake. */ @@ -191,6 +235,12 @@ pset_childp (struct Lisp_Process *p, Lisp_Object val) p->childp = val; } +INLINE void +pset_status (struct Lisp_Process *p, Lisp_Object val) +{ + p->status = val; +} + #ifdef HAVE_GNUTLS INLINE void pset_gnutls_cred_type (struct Lisp_Process *p, Lisp_Object val) @@ -225,7 +275,7 @@ extern Lisp_Object system_process_attributes (Lisp_Object); extern void record_deleted_pid (pid_t, Lisp_Object); struct sockaddr; -extern Lisp_Object conv_sockaddr_to_lisp (struct sockaddr *, int); +extern Lisp_Object conv_sockaddr_to_lisp (struct sockaddr *, ptrdiff_t); extern void hold_keyboard_input (void); extern void unhold_keyboard_input (void); extern bool kbd_on_hold_p (void); @@ -237,6 +287,7 @@ extern void delete_read_fd (int fd); extern void add_write_fd (int fd, fd_callback func, void *data); extern void delete_write_fd (int fd); extern void catch_child_signal (void); +extern void restore_nofile_limit (void); #ifdef WINDOWSNT extern Lisp_Object network_interface_list (void); @@ -245,6 +296,8 @@ extern Lisp_Object network_interface_info (Lisp_Object); extern Lisp_Object remove_slash_colon (Lisp_Object); +extern void update_processes_for_thread_death (Lisp_Object); + INLINE_HEADER_END #endif /* EMACS_PROCESS_H */ |