![]() |
![]() |
![]() |
![]() |
Mount a filesystem
#include <sys/mount.h> int mount( const char* spec, const char* dir, int flags, const char* type, const void* data, int datalen );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The mount() function sends a request to servers to mount the services provided by spec and type at dir.
![]() |
Updating the mount resets the other mount flags to their default values.
To determine which flags are currently set, use the
DCMD_ALL_GETMOUNTFLAGS devctl() command,
and then OR in _MOUNT_REMOUNT.
For example:
int flags; if(devctl(fd, DCMD_ALL_GETMOUNTFLAGS, &flags, sizeof flags, NULL) == EOK) { flags |= _MOUNT_REMOUNT; ... } |
If you set _MFLAG_OCB in the flags, then the special device string is ignored, and all servers are contacted. If you don't set this bit, and the special device spec exists, then only the server that created that device is contacted, and the full path to spec is provided.
If datalen is any value <0, and there's a data pointer, the function assumes that the data pointer is a pointer to a string.
-1 on failure; no server supports the request (errno is set).
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
mount_parse_generic_args(), resmgr_attach(), umount()
“Layers in a resource manager” in the Bones of a Resource Manager chapter of Writing a Resource Manager
![]() |
![]() |
![]() |
![]() |