summaryrefslogtreecommitdiff
path: root/src/w32proc.c
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-08-19 16:48:59 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-08-19 16:48:59 -0700
commit07fcbb558d797272b9f43547da60beda485873a3 (patch)
tree77d5da14e9f9d9d8b1d877c70c01296fd3893796 /src/w32proc.c
parentc9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff)
parentfb81c8c3adf8633f2f617c82f6019aef630860c7 (diff)
downloademacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'src/w32proc.c')
-rw-r--r--src/w32proc.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index 2b6cb9c1e1d..702ea122e65 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -623,7 +623,7 @@ init_timers (void)
need to probe for its availability dynamically, and call it
through a pointer. */
s_pfn_Get_Thread_Times = NULL; /* in case dumped Emacs comes with a value */
- if (os_subtype != OS_9X)
+ if (os_subtype != OS_SUBTYPE_9X)
s_pfn_Get_Thread_Times = (GetThreadTimes_Proc)
get_proc_addr (GetModuleHandle ("kernel32.dll"), "GetThreadTimes");
@@ -1918,7 +1918,8 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
{
program = build_string (cmdname);
full = Qnil;
- openp (Vexec_path, program, Vexec_suffixes, &full, make_fixnum (X_OK), 0);
+ openp (Vexec_path, program, Vexec_suffixes, &full, make_fixnum (X_OK),
+ 0, 0);
if (NILP (full))
{
errno = EINVAL;
@@ -2653,7 +2654,7 @@ find_child_console (HWND hwnd, LPARAM arg)
GetClassName (hwnd, window_class, sizeof (window_class));
if (strcmp (window_class,
- (os_subtype == OS_9X)
+ (os_subtype == OS_SUBTYPE_9X)
? "tty"
: "ConsoleWindowClass") == 0)
{
@@ -2877,7 +2878,7 @@ sys_kill (pid_t pid, int sig)
if (NILP (Vw32_start_process_share_console) && cp && cp->hwnd)
{
#if 1
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
/*
Another possibility is to try terminating the VDM out-right by
@@ -3792,7 +3793,7 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
if (!g_b_init_compare_string_w)
{
- if (os_subtype == OS_9X)
+ if (os_subtype == OS_SUBTYPE_9X)
{
pCompareStringW = (CompareStringW_Proc)
get_proc_addr (LoadLibrary ("Unicows.dll"),
@@ -3877,6 +3878,14 @@ w32_compare_strings (const char *s1, const char *s2, char *locname,
return val - 2;
}
+DEFUN ("w32-get-nproc", Fw32_get_nproc,
+ Sw32_get_nproc, 0, 0, 0,
+ doc: /* Return the number of system's processor execution units. */)
+ (void)
+{
+ return make_fixnum (w32_get_nproc ());
+}
+
void
syms_of_ntproc (void)
@@ -3911,6 +3920,8 @@ syms_of_ntproc (void)
defsubr (&Sw32_get_keyboard_layout);
defsubr (&Sw32_set_keyboard_layout);
+ defsubr (&Sw32_get_nproc);
+
DEFVAR_LISP ("w32-quote-process-args", Vw32_quote_process_args,
doc: /* Non-nil enables quoting of process arguments to ensure correct parsing.
Because Windows does not directly pass argv arrays to child processes,