aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorYuan Fu2022-06-14 15:59:46 -0700
committerYuan Fu2022-06-14 15:59:46 -0700
commit98bfb240818bae14cd87a1ffeb8fae7cb7846e05 (patch)
tree16e8ab06875ed54e110cf98ccdbd7e78f15905c6 /src/process.c
parent184d212042ffa5a4f02c92085d9b6e8346d66e99 (diff)
parent787c4ad8b0776280305a220d6669c956d9ed8a5d (diff)
downloademacs-98bfb240818bae14cd87a1ffeb8fae7cb7846e05.tar.gz
emacs-98bfb240818bae14cd87a1ffeb8fae7cb7846e05.zip
Merge remote-tracking branch 'savannah/master' into feature/tree-sitter
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/process.c b/src/process.c
index 08a02ad9423..ccfc0bdf547 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1071,13 +1071,24 @@ record_deleted_pid (pid_t pid, Lisp_Object filename)
1071 1071
1072} 1072}
1073 1073
1074DEFUN ("delete-process", Fdelete_process, Sdelete_process, 1, 1, 0, 1074DEFUN ("delete-process", Fdelete_process, Sdelete_process, 0, 1,
1075 "(list 'message)",
1075 doc: /* Delete PROCESS: kill it and forget about it immediately. 1076 doc: /* Delete PROCESS: kill it and forget about it immediately.
1076PROCESS may be a process, a buffer, the name of a process or buffer, or 1077PROCESS may be a process, a buffer, the name of a process or buffer, or
1077nil, indicating the current buffer's process. */) 1078nil, indicating the current buffer's process.
1079
1080Interactively, it will kill the current buffer's process. */)
1078 (register Lisp_Object process) 1081 (register Lisp_Object process)
1079{ 1082{
1080 register struct Lisp_Process *p; 1083 register struct Lisp_Process *p;
1084 bool mess = false;
1085
1086 /* We use this to see whether we were called interactively. */
1087 if (EQ (process, Qmessage))
1088 {
1089 mess = true;
1090 process = Qnil;
1091 }
1081 1092
1082 process = get_process (process); 1093 process = get_process (process);
1083 p = XPROCESS (process); 1094 p = XPROCESS (process);
@@ -1131,6 +1142,8 @@ nil, indicating the current buffer's process. */)
1131 } 1142 }
1132 } 1143 }
1133 remove_process (process); 1144 remove_process (process);
1145 if (mess)
1146 message ("Deleted process");
1134 return Qnil; 1147 return Qnil;
1135} 1148}
1136 1149
@@ -2132,6 +2145,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
2132 inchannel = p->open_fd[READ_FROM_SUBPROCESS]; 2145 inchannel = p->open_fd[READ_FROM_SUBPROCESS];
2133 forkout = p->open_fd[SUBPROCESS_STDOUT]; 2146 forkout = p->open_fd[SUBPROCESS_STDOUT];
2134 2147
2148#if defined(GNU_LINUX) && defined(F_SETPIPE_SZ)
2149 fcntl (inchannel, F_SETPIPE_SZ, read_process_output_max);
2150#endif
2151
2135 if (!NILP (p->stderrproc)) 2152 if (!NILP (p->stderrproc))
2136 { 2153 {
2137 struct Lisp_Process *pp = XPROCESS (p->stderrproc); 2154 struct Lisp_Process *pp = XPROCESS (p->stderrproc);
@@ -4766,7 +4783,7 @@ corresponding connection was closed. */)
4766 SDATA (proc->name), 4783 SDATA (proc->name),
4767 STRINGP (proc_thread_name) 4784 STRINGP (proc_thread_name)
4768 ? SDATA (proc_thread_name) 4785 ? SDATA (proc_thread_name)
4769 : SDATA (Fprin1_to_string (proc->thread, Qt))); 4786 : SDATA (Fprin1_to_string (proc->thread, Qt, Qnil)));
4770 } 4787 }
4771 } 4788 }
4772 else 4789 else
@@ -8618,7 +8635,10 @@ returns non-nil. */);
8618 DEFVAR_INT ("read-process-output-max", read_process_output_max, 8635 DEFVAR_INT ("read-process-output-max", read_process_output_max,
8619 doc: /* Maximum number of bytes to read from subprocess in a single chunk. 8636 doc: /* Maximum number of bytes to read from subprocess in a single chunk.
8620Enlarge the value only if the subprocess generates very large (megabytes) 8637Enlarge the value only if the subprocess generates very large (megabytes)
8621amounts of data in one go. */); 8638amounts of data in one go.
8639
8640On GNU/Linux systems, the value should not exceed
8641/proc/sys/fs/pipe-max-size. See pipe(7) manpage for details. */);
8622 read_process_output_max = 4096; 8642 read_process_output_max = 4096;
8623 8643
8624 DEFVAR_INT ("process-error-pause-time", process_error_pause_time, 8644 DEFVAR_INT ("process-error-pause-time", process_error_pause_time,
@@ -8637,6 +8657,7 @@ sentinel or a process filter function has an error. */);
8637 8657
8638 DEFSYM (Qnull, "null"); 8658 DEFSYM (Qnull, "null");
8639 DEFSYM (Qpipe_process_p, "pipe-process-p"); 8659 DEFSYM (Qpipe_process_p, "pipe-process-p");
8660 DEFSYM (Qmessage, "message");
8640 8661
8641 defsubr (&Sprocessp); 8662 defsubr (&Sprocessp);
8642 defsubr (&Sget_process); 8663 defsubr (&Sget_process);