Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mnt(3) [plan9 man page]

MNT(3)							     Library Functions Manual							    MNT(3)

NAME
mnt - attach to 9P servers SYNOPSIS
#M DESCRIPTION
The mount driver is used by the mount system call (but not bind; see bind(2)) to connect the name space of a process to the service pro- vided by a 9P server over a communications channel. After the mount, system calls involving files in that portion of the name space will be converted by the mount driver into the appropriate 9P messages to the server. The mount system call issues session and attach(5) messages to the server to identify and validate the user of the connection. Each dis- tinct user of a connection must mount it separately; the mount driver multiplexes the access of the various users and their processes to the service. File-oriented system calls are converted by the kernel into messages in the 9P protocol. Within the kernel, 9P is implemented by procedure calls to the various kernel device drivers. The mount driver translates these procedure calls into remote procedure calls to be transmit- ted as messages over the communication channel to the server. Each message is implemented by a write of the corresponding protocol message to the server channel followed by a read on the server channel to get the reply. Errors in the reply message are turned into system call error returns. A read(2) or write system call on a file served by the mount driver may be translated into more than one message, since there is a maximum data size for a 9P message. The system call will return when the specified number of bytes have been transferred or a short reply is returned. The string is an illegal file name, so this device can only be accessed directly by the kernel. SEE ALSO
bind(2) SOURCE
/sys/src/9/port/devmnt.c BUGS
When mounting a service through the mount driver, that is, when the channel being multiplexed is itself a file being served by the mount driver, large messages may be broken in two. MNT(3)

Check Out this Related Man Page

BIND(2) 							System Calls Manual							   BIND(2)

NAME
bind, mount, unmount - change name space SYNOPSIS
#include <u.h> #include <libc.h> int bind(char *name, char *old, int flag) int mount(int fd, char *old, int flag, char *aname) int unmount(char *name, char *old) DESCRIPTION
Bind and mount modify the file name space of the current process and other processes in its name space group (see fork(2)). For both calls, old is the name of an existing file or directory in the current name space where the modification is to be made. The name old is evaluated as described in intro(2), except that no translation of the final path element is done. For bind, name is the name of another (or possibly the same) existing file or directory in the current name space. After a successful bind call, the file name old is an alias for the object originally named by name; if the modification doesn't hide it, name will also still refer to its original file. The evaluation of new happens at the time of the bind, not when the binding is later used. The fd argument to mount is a file descriptor of an open network connection or pipe to a file server. The old file must be a directory. After a successful mount the file tree served (see below) by fd will be visible with its root directory having name old. The flag controls details of the modification made to the name space. In the following, new refers to the file as defined by name or the root directory served by fd. Either both old and new files must be directories, or both must not be directories. Flag can be one of: MREPL Replace the old file by the new one. Henceforth, an evaluation of old will be translated to the new file. If they are directories (for mount, this condition is true by definition), old becomes a union directory consisting of one directory (the new file). MBEFORE Both the old and new files must be directories. Add the constituent files of the new directory to the union directory at old so its contents appear first in the union. After an MBEFORE bind or mount, the new directory will be searched first when evaluating file names in the union directory. MAFTER Like MBEFORE but the new directory goes at the end of the union. The flags are defined in <libc.h>. In addition, there is an MCREATE flag that can be OR'd with any of the above. When a create system call (see open(2)) attempts to create in a union directory, and the file does not exist, the elements of the union are searched in order until one is found with MCREATE set. The file is created in that directory; if that attempt fails, the create fails. With mount, the file descriptor fd must be open for reading and writing and prepared to respond to 9P messages (see Section 5). After the mount, the file tree starting at old is served by a kernel mnt(3) device. That device will turn operations in the tree into messages on fd. Aname selects among different file trees on the server; the null string chooses the default tree. The file descriptor fd is automatically closed by a successful mount call. The effects of bind and mount can be undone by unmount. If name is zero, everything bound to or mounted upon old is unbound or unmounted. If name is not zero, it is evaluated as described above for bind, and the effect of binding or mounting that particular result on old is undone. SOURCE
/sys/src/libc/9syscall SEE ALSO
bind(1), intro(2), fcall(2), auth(2) (particularly amount), intro(5), mnt(3), srv(3) DIAGNOSTICS
The return value is a positive integer (a unique sequence number) for success, -1 for failure. These routines set errstr. BUGS
Mount will not return until it has successfully attached to the file server, so the process doing a mount cannot be the one serving. BIND(2)
Man Page