mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 22:40:57 +00:00
process: disable building execve on IBM i
The `execve` syscall does exist on IBM i but it has caveats that make it not usable in Node.js context. These changes disable building with `execve` like Windows does. PR-URL: https://github.com/nodejs/node/pull/57883 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
This commit is contained in:
parent
782c2e0fe4
commit
963b24e9a6
@ -3379,7 +3379,7 @@ any exit or close events and without running any cleanup handler.
|
|||||||
|
|
||||||
This function will never return, unless an error occurred.
|
This function will never return, unless an error occurred.
|
||||||
|
|
||||||
This function is not available on Windows.
|
This function is not available on Windows or IBM i.
|
||||||
|
|
||||||
## `process.report`
|
## `process.report`
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ function wrapProcessMethods(binding) {
|
|||||||
|
|
||||||
if (!isMainThread) {
|
if (!isMainThread) {
|
||||||
throw new ERR_WORKER_UNSUPPORTED_OPERATION('Calling process.execve');
|
throw new ERR_WORKER_UNSUPPORTED_OPERATION('Calling process.execve');
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32' || process.platform === 'os400') {
|
||||||
throw new ERR_FEATURE_UNAVAILABLE_ON_PLATFORM('process.execve');
|
throw new ERR_FEATURE_UNAVAILABLE_ON_PLATFORM('process.execve');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ static void ReallyExit(const FunctionCallbackInfo<Value>& args) {
|
|||||||
env->Exit(code);
|
env->Exit(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __POSIX__
|
#if defined __POSIX__ && !defined(__PASE__)
|
||||||
inline int persist_standard_stream(int fd) {
|
inline int persist_standard_stream(int fd) {
|
||||||
int flags = fcntl(fd, F_GETFD, 0);
|
int flags = fcntl(fd, F_GETFD, 0);
|
||||||
|
|
||||||
@ -783,7 +783,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
|
|||||||
SetMethod(isolate, target, "dlopen", binding::DLOpen);
|
SetMethod(isolate, target, "dlopen", binding::DLOpen);
|
||||||
SetMethod(isolate, target, "reallyExit", ReallyExit);
|
SetMethod(isolate, target, "reallyExit", ReallyExit);
|
||||||
|
|
||||||
#ifdef __POSIX__
|
#if defined __POSIX__ && !defined(__PASE__)
|
||||||
SetMethod(isolate, target, "execve", Execve);
|
SetMethod(isolate, target, "execve", Execve);
|
||||||
#endif
|
#endif
|
||||||
SetMethodNoSideEffect(isolate, target, "uptime", Uptime);
|
SetMethodNoSideEffect(isolate, target, "uptime", Uptime);
|
||||||
@ -830,7 +830,7 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
|
|||||||
registry->Register(binding::DLOpen);
|
registry->Register(binding::DLOpen);
|
||||||
registry->Register(ReallyExit);
|
registry->Register(ReallyExit);
|
||||||
|
|
||||||
#ifdef __POSIX__
|
#if defined __POSIX__ && !defined(__PASE__)
|
||||||
registry->Register(Execve);
|
registry->Register(Execve);
|
||||||
#endif
|
#endif
|
||||||
registry->Register(Uptime);
|
registry->Register(Uptime);
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { skip, isWindows } = require('../common');
|
const { skip, isWindows, isIBMi } = require('../common');
|
||||||
const { ok } = require('assert');
|
const { ok } = require('assert');
|
||||||
const { spawnSync } = require('child_process');
|
const { spawnSync } = require('child_process');
|
||||||
const { isMainThread } = require('worker_threads');
|
const { isMainThread } = require('worker_threads');
|
||||||
|
|
||||||
if (!isMainThread) {
|
if (!isMainThread) {
|
||||||
skip('process.execve is not available in Workers');
|
skip('process.execve is not available in Workers');
|
||||||
} else if (isWindows) {
|
} else if (isWindows || isIBMi) {
|
||||||
skip('process.execve is not available in Windows');
|
skip('process.execve is not available in Windows or IBM i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.argv[2] === 'child') {
|
if (process.argv[2] === 'child') {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { mustNotCall, skip, isWindows } = require('../common');
|
const { mustNotCall, skip, isWindows, isIBMi } = require('../common');
|
||||||
const { strictEqual } = require('assert');
|
const { strictEqual } = require('assert');
|
||||||
const { isMainThread } = require('worker_threads');
|
const { isMainThread } = require('worker_threads');
|
||||||
|
|
||||||
if (!isMainThread) {
|
if (!isMainThread) {
|
||||||
skip('process.execve is not available in Workers');
|
skip('process.execve is not available in Workers');
|
||||||
} else if (isWindows) {
|
} else if (isWindows || isIBMi) {
|
||||||
skip('process.execve is not available in Windows');
|
skip('process.execve is not available in Windows or IBM i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.argv[2] === 'replaced') {
|
if (process.argv[2] === 'replaced') {
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { mustCall, skip, isWindows } = require('../common');
|
const { mustCall, skip, isWindows, isIBMi } = require('../common');
|
||||||
const { fail, throws } = require('assert');
|
const { fail, throws } = require('assert');
|
||||||
const { isMainThread } = require('worker_threads');
|
const { isMainThread } = require('worker_threads');
|
||||||
|
|
||||||
if (!isMainThread) {
|
if (!isMainThread) {
|
||||||
skip('process.execve is not available in Workers');
|
skip('process.execve is not available in Workers');
|
||||||
} else if (isWindows) {
|
} else if (isWindows || isIBMi) {
|
||||||
skip('process.execve is not available in Windows');
|
skip('process.execve is not available in Windows or IBM i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.argv[2] === 'replaced') {
|
if (process.argv[2] === 'replaced') {
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { skip, isWindows } = require('../common');
|
const { skip, isWindows, isIBMi } = require('../common');
|
||||||
const { deepStrictEqual } = require('assert');
|
const { deepStrictEqual } = require('assert');
|
||||||
const { isMainThread } = require('worker_threads');
|
const { isMainThread } = require('worker_threads');
|
||||||
|
|
||||||
if (!isMainThread) {
|
if (!isMainThread) {
|
||||||
skip('process.execve is not available in Workers');
|
skip('process.execve is not available in Workers');
|
||||||
} else if (isWindows) {
|
} else if (isWindows || isIBMi) {
|
||||||
skip('process.execve is not available in Windows');
|
skip('process.execve is not available in Windows or IBM i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.argv[2] === 'replaced') {
|
if (process.argv[2] === 'replaced') {
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { mustCall, mustNotCall, skip, isWindows } = require('../common');
|
const { mustCall, mustNotCall, skip, isWindows, isIBMi } = require('../common');
|
||||||
const { fail, ok } = require('assert');
|
const { fail, ok } = require('assert');
|
||||||
const { createServer } = require('net');
|
const { createServer } = require('net');
|
||||||
const { isMainThread } = require('worker_threads');
|
const { isMainThread } = require('worker_threads');
|
||||||
|
|
||||||
if (!isMainThread) {
|
if (!isMainThread) {
|
||||||
skip('process.execve is not available in Workers');
|
skip('process.execve is not available in Workers');
|
||||||
} else if (isWindows) {
|
} else if (isWindows || isIBMi) {
|
||||||
skip('process.execve is not available in Windows');
|
skip('process.execve is not available in Windows or IBM i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.argv[2] === 'replaced') {
|
if (process.argv[2] === 'replaced') {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { skip, isWindows } = require('../common');
|
const { skip, isWindows, isIBMi } = require('../common');
|
||||||
const { throws } = require('assert');
|
const { throws } = require('assert');
|
||||||
const { isMainThread } = require('worker_threads');
|
const { isMainThread } = require('worker_threads');
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ if (!isMainThread) {
|
|||||||
skip('process.execve is not available in Workers');
|
skip('process.execve is not available in Workers');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isWindows) {
|
if (!isWindows && !isIBMi) {
|
||||||
// Invalid path name
|
// Invalid path name
|
||||||
{
|
{
|
||||||
throws(() => {
|
throws(() => {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { isWindows, mustCall, skip } = require('../common');
|
const { isWindows, isIBMi, mustCall, skip } = require('../common');
|
||||||
const { throws } = require('assert');
|
const { throws } = require('assert');
|
||||||
const { isMainThread, Worker } = require('worker_threads');
|
const { isMainThread, Worker } = require('worker_threads');
|
||||||
|
|
||||||
if (isWindows) {
|
if (isWindows || isIBMi) {
|
||||||
skip('process.execve is not available in Windows');
|
skip('process.execve is not available in Windows or IBM i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isMainThread) {
|
if (isMainThread) {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { isWindows, skip } = require('../common');
|
const { isWindows, isIBMi, skip } = require('../common');
|
||||||
const { deepStrictEqual, fail, strictEqual } = require('assert');
|
const { deepStrictEqual, fail, strictEqual } = require('assert');
|
||||||
const { isMainThread } = require('worker_threads');
|
const { isMainThread } = require('worker_threads');
|
||||||
|
|
||||||
if (!isMainThread) {
|
if (!isMainThread) {
|
||||||
skip('process.execve is not available in Workers');
|
skip('process.execve is not available in Workers');
|
||||||
} else if (isWindows) {
|
} else if (isWindows || isIBMi) {
|
||||||
skip('process.execve is not available in Windows');
|
skip('process.execve is not available in Windows or IBM i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.argv[2] === 'replaced') {
|
if (process.argv[2] === 'replaced') {
|
||||||
|
Loading…
Reference in New Issue
Block a user