Skip to content

Do not set FD_CLOEXEC on the FUSE fd on QNX - #410

Closed
gowtham0992 wants to merge 1 commit into
libfuse:masterfrom
gowtham0992:qnx-no-fuse-fd
Closed

gowtham0992 wants to merge 1 commit into
libfuse:masterfrom
gowtham0992:qnx-no-fuse-fd

Conversation

@gowtham0992

@gowtham0992 gowtham0992 commented Nov 21, 2026 •

Copy link
Copy Markdown

On QNX there is no /dev/fuse descriptor. The FUSE API is provided over native message passing by QFuse, a library that implements the libfuse 3 high-level API on top of QNX resource managers, and it has no fuse_session_fd(). This extends the existing __CYGWIN__ / __APPLE__ guard around the FD_CLOEXEC call to __QNXNTO__. It is the only change needed.

With it, current master (ba33bab, 3.7.7) builds with the QNX SDP 8.0 compiler for aarch64le and x86_64 and, on QNX 8.0 in QEMU on both architectures, passes:

  • read-only: a 200,037-byte binary file compared with a separately transferred reference, pread and EOF, directory listing, an empty file, a missing path, read-only errors, graceful shutdown and remount, and exit with the mount detached when the host key does not match;
  • writable: eight concurrent clients creating, writing, renaming, reading and unlinking, plus pwrite, truncate, chmod, timestamps, rename, symlink, statfs and persistence across a remount.

How it was built: sshfs.c and cache.c were compiled directly with the same definitions meson.build passes (-D_REENTRANT -DHAVE_CONFIG_H -DFUSE_USE_VERSION=31, a config.h with PACKAGE_VERSION and IDMAP_DEFAULT "none") against GLib built for QNX. I did not run meson for the QNX cross build, and the project's own test suite was not run on QNX. The tests above are tests/test_sshfs.c and tests/test_sshfs_write.c in the QFuse repository, run against a loopback OpenSSH SFTP server with key authentication and a pinned host key. No physical target was tested.

There is no /dev/fuse descriptor on QNX: the FUSE API is provided over
native message passing and fuse_session_fd() does not exist there.
@gowtham0992

Copy link
Copy Markdown
Author

Withdrawing this: it is no longer needed, and it should not have asked SSHFS to carry a guard for a third-party FUSE library.

QFuse now provides fuse_session_fd() itself, returning -1 because there is no FUSE device on QNX. With that, current master (ba33bab, 3.7.7) builds for QNX 8.0 with no source change and passes the same read-only and writable SFTP checks on aarch64le and x86_64. The only visible effect is the existing "failed to set FD_CLOEXEC on fuse device" warning at start.

Thank you for your time, and sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant