0

Normally, when using a FUSE server (aka FUSE module or FUSE filesystem) the Linux kernel acts as the FUSE client. They talk a protocol that is semi-documented, but mostly only ever looked at by kernel authors or libfuse authors. I would like to try interacting with a FUSE server directly in my own application, independent of the kernel, as a child process of my own program. In other words, I want to write a FUSE client.

I found this protocol document in the libfuse wiki and I could start experimenting with this, but first I have to figure out how to launch the FUSE server.

When I mount sshfs, the process list shows me

sshfs $HOST:$PATH $MOUNTPATH

and the file descriptors according to /proc are

0 -> /dev/null
1 -> /dev/null
2 -> /dev/null
3 -> /dev/fuse
4 -> 'socket:[7464782]'

I assume the socket is the SSH connection. The /dev/fuse is what I'm trying to figure out now. Did the kernel open that file handle and pass it to the fuse program as descriptor 3? or did sshfs open /dev/fuse itself? If the FUSE server is connecting to the kernel, how could I get it to connect to a pipe I provide it, instead?

More generally, can someone describe the initialization sequence between the kernel and userspace that leads to the client <-> server pipe? This is the part I can't find any documentation about.

M Conrad
  • 973
  • 4
  • 13

0 Answers0