From f6cd4e3e5976ce9edccdb13933028bdc95d43df4 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 15 Jan 2019 15:39:43 -0500 Subject: [PATCH] process: allow reading umask in workers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/issues/25448 PR-URL: https://github.com/nodejs/node/pull/25526 Reviewed-By: Ruben Bridgewater Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung --- doc/api/errors.md | 5 +++++ doc/api/process.md | 3 ++- lib/internal/bootstrap/node.js | 4 ++++ lib/internal/errors.js | 2 ++ lib/internal/process/worker_thread_only.js | 21 ++++++++++++++++++++- src/node_process_methods.cc | 7 ++++++- test/common/index.js | 9 ++++----- test/parallel/test-fs-write-file-sync.js | 2 +- test/parallel/test-process-umask-mask.js | 2 +- test/parallel/test-process-umask.js | 11 +++++++++-- 10 files changed, 54 insertions(+), 12 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index bb903ed0ee8c15..840ba9b85c12c2 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1926,6 +1926,11 @@ All attempts at serializing an uncaught exception from a worker thread failed. The pathname used for the main script of a worker has an unknown file extension. + +### ERR_WORKER_UNSUPPORTED_OPERATION + +The requested functionality is not supported in worker threads. + ### ERR_ZLIB_INITIALIZATION_FAILED diff --git a/doc/api/process.md b/doc/api/process.md index 28ed9734f55144..0ba97f851cce9f 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2007,7 +2007,8 @@ console.log( ); ``` -This feature is not available in [`Worker`][] threads. +[`Worker`][] threads are able to read the umask, however attempting to set the +umask will result in a thrown exception. ## process.uptime()