Files
node/doc/api
Philipp Dunkel ee36353428 vfs: load native addons from a mounted file system
A native addon inside a virtual file system could not be require()d:
dlopen() and LoadLibrary() open a shared object by path, and a VFS path
has no inode for them to open.

Read the addon's bytes from the VFS and load them from a private,
self-cleaning image instead, using the smallest on-disk footprint each
platform allows: on Linux an anonymous memfd loaded through
/proc/self/fd, so the bytes never reach the file system; on other POSIX
platforms a file in a 0700 mkdtemp() directory, unlinked right after
loading, with the mapping keeping it alive; on Windows a temp file
opened FILE_FLAG_DELETE_ON_CLOSE whose handle is held until exit.

This is internal. process.dlopen() keeps its documented
(module, filename[, flags]) signature and ignores anything further; the
bytes are passed to a dlopenBinary() reachable only through the
process_methods binding, which the VFS hook calls for VFS paths. Addons
on the real file system are untouched and load directly.

Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
PR-URL: https://github.com/nodejs/node/pull/65680
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-09-04 16:48:33 +00:00
..
2026-09-03 11:40:52 +02:00
2026-08-01 06:15:08 +00:00
2026-07-18 10:18:51 +00:00
2026-08-29 00:58:18 +02:00
2026-08-31 03:59:10 +00:00
2026-09-04 14:26:28 +00:00
2026-08-30 20:44:06 +02:00
2026-09-03 15:37:21 +00:00
2025-12-16 20:31:28 +00:00
2026-08-26 16:23:36 +02:00
2026-08-22 03:49:24 +00:00
2026-08-26 16:23:36 +02:00
2026-08-28 00:23:11 +00:00
2026-08-03 11:44:23 +00:00
2026-08-26 16:23:36 +02:00
2026-08-26 16:23:36 +02:00
2026-09-02 05:48:32 +00:00
2026-08-26 16:23:36 +02:00