Skip to content

process: disable building execve on IBM i #57883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 is not available on Windows.
This function is not available on Windows or IBM i.

## `process.report`

Expand Down
2 changes: 1 addition & 1 deletion lib/internal/process/per_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function wrapProcessMethods(binding) {

if (!isMainThread) {
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');
}

Expand Down
6 changes: 3 additions & 3 deletions src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ static void ReallyExit(const FunctionCallbackInfo<Value>& args) {
env->Exit(code);
}

#ifdef __POSIX__
#if defined __POSIX__ && !defined(__PASE__)
inline int persist_standard_stream(int fd) {
int flags = fcntl(fd, F_GETFD, 0);

Expand Down Expand Up @@ -779,7 +779,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
SetMethod(isolate, target, "dlopen", binding::DLOpen);
SetMethod(isolate, target, "reallyExit", ReallyExit);

#ifdef __POSIX__
#if defined __POSIX__ && !defined(__PASE__)
SetMethod(isolate, target, "execve", Execve);
#endif
SetMethodNoSideEffect(isolate, target, "uptime", Uptime);
Expand Down Expand Up @@ -826,7 +826,7 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
registry->Register(binding::DLOpen);
registry->Register(ReallyExit);

#ifdef __POSIX__
#if defined __POSIX__ && !defined(__PASE__)
registry->Register(Execve);
#endif
registry->Register(Uptime);
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-process-execve-abort.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

const { skip, isWindows } = require('../common');
const { skip, isWindows, isIBMi } = require('../common');
const { ok } = require('assert');
const { spawnSync } = require('child_process');
const { isMainThread } = require('worker_threads');

if (!isMainThread) {
skip('process.execve is not available in Workers');
} else if (isWindows) {
skip('process.execve is not available in Windows');
} else if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}

if (process.argv[2] === 'child') {
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-process-execve-on-exit.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

const { mustNotCall, skip, isWindows } = require('../common');
const { mustNotCall, skip, isWindows, isIBMi } = require('../common');
const { strictEqual } = require('assert');
const { isMainThread } = require('worker_threads');

if (!isMainThread) {
skip('process.execve is not available in Workers');
} else if (isWindows) {
skip('process.execve is not available in Windows');
} else if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}

if (process.argv[2] === 'replaced') {
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-process-execve-permission-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

'use strict';

const { mustCall, skip, isWindows } = require('../common');
const { mustCall, skip, isWindows, isIBMi } = require('../common');
const { fail, throws } = require('assert');
const { isMainThread } = require('worker_threads');

if (!isMainThread) {
skip('process.execve is not available in Workers');
} else if (isWindows) {
skip('process.execve is not available in Windows');
} else if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}

if (process.argv[2] === 'replaced') {
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-process-execve-permission-granted.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

'use strict';

const { skip, isWindows } = require('../common');
const { skip, isWindows, isIBMi } = require('../common');
const { deepStrictEqual } = require('assert');
const { isMainThread } = require('worker_threads');

if (!isMainThread) {
skip('process.execve is not available in Workers');
} else if (isWindows) {
skip('process.execve is not available in Windows');
} else if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}

if (process.argv[2] === 'replaced') {
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-process-execve-socket.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

const { mustCall, mustNotCall, skip, isWindows } = require('../common');
const { mustCall, mustNotCall, skip, isWindows, isIBMi } = require('../common');
const { fail, ok } = require('assert');
const { createServer } = require('net');
const { isMainThread } = require('worker_threads');

if (!isMainThread) {
skip('process.execve is not available in Workers');
} else if (isWindows) {
skip('process.execve is not available in Windows');
} else if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}

if (process.argv[2] === 'replaced') {
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-process-execve-validation.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

const { skip, isWindows } = require('../common');
const { skip, isWindows, isIBMi } = require('../common');
const { throws } = require('assert');
const { isMainThread } = require('worker_threads');

if (!isMainThread) {
skip('process.execve is not available in Workers');
}

if (!isWindows) {
if (!isWindows && !isIBMi) {
// Invalid path name
{
throws(() => {
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-process-execve-worker-threads.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

const { isWindows, mustCall, skip } = require('../common');
const { isWindows, isIBMi, mustCall, skip } = require('../common');
const { throws } = require('assert');
const { isMainThread, Worker } = require('worker_threads');

if (isWindows) {
skip('process.execve is not available in Windows');
if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}

if (isMainThread) {
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-process-execve.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

const { isWindows, skip } = require('../common');
const { isWindows, isIBMi, skip } = require('../common');
const { deepStrictEqual, fail, strictEqual } = require('assert');
const { isMainThread } = require('worker_threads');

if (!isMainThread) {
skip('process.execve is not available in Workers');
} else if (isWindows) {
skip('process.execve is not available in Windows');
} else if (isWindows || isIBMi) {
skip('process.execve is not available in Windows or IBM i');
}

if (process.argv[2] === 'replaced') {
Expand Down
Loading