diff options
| author | Glenn Morris | 2021-10-11 08:04:57 -0700 |
|---|---|---|
| committer | Glenn Morris | 2021-10-11 08:04:57 -0700 |
| commit | 8aceb37b47a8f97fc42caaaf021ac06dc9f67827 (patch) | |
| tree | 64e2d073d3980d633a68349b8872b534a5427d59 /src/process.c | |
| parent | 395273773cb7035358cdd7c87f9102af75e39915 (diff) | |
| parent | 1a1b206a8b33dc597fe2153a59fa30baacf1dcc8 (diff) | |
| download | emacs-8aceb37b47a8f97fc42caaaf021ac06dc9f67827.tar.gz emacs-8aceb37b47a8f97fc42caaaf021ac06dc9f67827.zip | |
Merge from origin/emacs-28
1a1b206a8b Adapt the recent 'num_processors' change to MS-Windows
7cb4637923 Minor fix to clarify a sentence in emacs-lisp-intro
ab60144ea3 ; Pacify recent shorthand unused lexarg warnings.
e9df86004f Make tty-run-terminal-initialization load the .elc file (i...
07edc28bdb Fix ert errors when there's a test that binds `debug-on-er...
96278de8ac New function num-processors
575e626105 Add symbol property 'save-some-buffers-function' (bug#46374)
a3e10af95c Keep reading when typed RET in read-char-from-minibuffer a...
013e3be832 * lisp/userlock.el (ask-user-about-supersession-threat): A...
ae61d7a57d Fix point positioning on mouse clicks with non-zero line-h...
4c7e74c386 Complete shorthands to longhands for symbol-completing tables
c2513c5d0d Add new failing test for bug#51089
1d1e96377c ; * lisp/emacs-lisp/shortdoc.el: Fix typo.
6bf29072e9 Avoid mapping file names through 'substring'
bcce93f04c Update to Org 9.5-46-gb71474
5d408f1a24 Expanded testing of MH-E with multiple MH variants
b497add971 Fix Seccomp filter for newer GNU/Linux systems (Bug#51073).
75d9fbec88 Tramp code cleanup
# Conflicts:
# etc/NEWS
# test/lisp/progmodes/elisp-mode-tests.el
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index 221d4c7f6c3..746cdc0428a 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -90,6 +90,7 @@ static struct rlimit nofile_limit; | |||
| 90 | 90 | ||
| 91 | #include <c-ctype.h> | 91 | #include <c-ctype.h> |
| 92 | #include <flexmember.h> | 92 | #include <flexmember.h> |
| 93 | #include <nproc.h> | ||
| 93 | #include <sig2str.h> | 94 | #include <sig2str.h> |
| 94 | #include <verify.h> | 95 | #include <verify.h> |
| 95 | 96 | ||
| @@ -8212,6 +8213,20 @@ integer or floating point values. | |||
| 8212 | return system_process_attributes (pid); | 8213 | return system_process_attributes (pid); |
| 8213 | } | 8214 | } |
| 8214 | 8215 | ||
| 8216 | DEFUN ("num-processors", Fnum_processors, Snum_processors, 0, 1, 0, | ||
| 8217 | doc: /* Return the number of processors, a positive integer. | ||
| 8218 | Each usable thread execution unit counts as a processor. | ||
| 8219 | By default, count the number of available processors, | ||
| 8220 | overridable via the OMP_NUM_THREADS environment variable. | ||
| 8221 | If optional argument QUERY is `current', ignore OMP_NUM_THREADS. | ||
| 8222 | If QUERY is `all', also count processors not available. */) | ||
| 8223 | (Lisp_Object query) | ||
| 8224 | { | ||
| 8225 | return make_uint (num_processors (EQ (query, Qall) ? NPROC_ALL | ||
| 8226 | : EQ (query, Qcurrent) ? NPROC_CURRENT | ||
| 8227 | : NPROC_CURRENT_OVERRIDABLE)); | ||
| 8228 | } | ||
| 8229 | |||
| 8215 | #ifdef subprocesses | 8230 | #ifdef subprocesses |
| 8216 | /* Arrange to catch SIGCHLD if this hasn't already been arranged. | 8231 | /* Arrange to catch SIGCHLD if this hasn't already been arranged. |
| 8217 | Invoke this after init_process_emacs, and after glib and/or GNUstep | 8232 | Invoke this after init_process_emacs, and after glib and/or GNUstep |
| @@ -8472,6 +8487,8 @@ syms_of_process (void) | |||
| 8472 | DEFSYM (Qpcpu, "pcpu"); | 8487 | DEFSYM (Qpcpu, "pcpu"); |
| 8473 | DEFSYM (Qpmem, "pmem"); | 8488 | DEFSYM (Qpmem, "pmem"); |
| 8474 | DEFSYM (Qargs, "args"); | 8489 | DEFSYM (Qargs, "args"); |
| 8490 | DEFSYM (Qall, "all"); | ||
| 8491 | DEFSYM (Qcurrent, "current"); | ||
| 8475 | 8492 | ||
| 8476 | DEFVAR_BOOL ("delete-exited-processes", delete_exited_processes, | 8493 | DEFVAR_BOOL ("delete-exited-processes", delete_exited_processes, |
| 8477 | doc: /* Non-nil means delete processes immediately when they exit. | 8494 | doc: /* Non-nil means delete processes immediately when they exit. |
| @@ -8633,4 +8650,5 @@ amounts of data in one go. */); | |||
| 8633 | defsubr (&Sprocess_inherit_coding_system_flag); | 8650 | defsubr (&Sprocess_inherit_coding_system_flag); |
| 8634 | defsubr (&Slist_system_processes); | 8651 | defsubr (&Slist_system_processes); |
| 8635 | defsubr (&Sprocess_attributes); | 8652 | defsubr (&Sprocess_attributes); |
| 8653 | defsubr (&Snum_processors); | ||
| 8636 | } | 8654 | } |