Skip to content

Mount syscall#196

Open
arihant2math wants to merge 3 commits intohexagonal-sun:masterfrom
arihant2math:mount
Open

Mount syscall#196
arihant2math wants to merge 3 commits intohexagonal-sun:masterfrom
arihant2math:mount

Conversation

@arihant2math
Copy link
Collaborator

@arihant2math arihant2math commented Feb 5, 2026

Implements mount. Includes a procfs bugfix because systemd mounts via procfs symlinks.

Testing: systemd

@arihant2math arihant2math marked this pull request as draft February 5, 2026 18:35
@arihant2math arihant2math force-pushed the mount branch 4 times, most recently from 65c81a2 to 2128015 Compare February 7, 2026 17:42
@arihant2math arihant2math marked this pull request as ready for review February 7, 2026 17:43
@arihant2math
Copy link
Collaborator Author

Seems like it is possible for this implementation to fault in normal operation, still debugging.

@arihant2math
Copy link
Collaborator Author

Ah, dev_name and type are optional.

@arihant2math arihant2math changed the title Mount syscalls Mount syscall Feb 8, 2026
Comment on lines +49 to +51
dev_name: TUA<c_char>,
dir_name: TUA<c_char>,
type_: TUA<c_char>,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by the args. According to the man page, mount looks like:

       int mount(const char *source, const char *target,
                 const char *filesystemtype, unsigned long mountflags,
                 const void *_Nullable data);

But the following code looks as though it's inspecting the source argument for the filesystem type. Shouldn't that be type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the table in etc/ it says:

(char *dev_name, char *dir_name, char *type, unsigned long flags, void *data)

filesystemtype (or type) is null when systemd calls this (which was what led to the EFAULT errors). I've got no clue why systemd calls this API the way does. Perhaps source could also be a device file, in which case type is used to specify the filesystem type?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, odd. I can understand why type could be null, you'd read the FS type from /etc/fstab, or inspect the block device to see if any of your FS driver match the magic and try to mount. Odd that it's not specified as nullable in the man page through.

# Conflicts:
#	src/drivers/fs/proc/task/fd.rs
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.

2 participants