Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ffm(4) [osf1 man page]

ffm(4)							     Kernel Interfaces Manual							    ffm(4)

NAME
ffm - File-on-File Mounting File System STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fattach(): XSH4.2 fdetach(): XSH4.2 Refer to standards(5) for more information about industry standards and their associated tags. DESCRIPTION
The File-on-File Mounting (FFM) file system allows regular files, character device special files, or block device special files to be mounted on regular files or directories. The ffm file system is used with the System V Release 4-compatible library functions fattach(3) and detach(3) to enable a user process to have one file descriptor pointing to the data associated with a named file and a named STREAM. When one name is active, the other name is invisible. For example, a user application mounts a file descriptor from a file named a_file on a file that is named b_file. The file descriptor of file a_file is accessible by two names, a_file and b_file. However, when the user application attempts to open either file, only the file descriptor for a_file is returned: the file descriptor for b_file is invisible while a_file is mounted over it. The fattach(3) function mounts a file over another; the fdetach(3) function removes the association so the underlying file can be accessed. The user process can also mount a regular file over a regular file in order for it to be a clone of the underlying file. [Do not confuse this clone with an AdvFS clone fileset.] In this case, the clone file is a character device special file that is associated with a device driver that handles such files. As a result, a user can specify one clone entry and then open this device multiple times. Each time the device is opened, a new vnode is obtained but exactly the same device behavoir is also obtained: the behavior is cloned. That mount occurs if the -o clone option is used in the mount command or as an element of a ffm line in the /etc/fstab file. In this case, there are two files with identical contents, separate names, and separate file descriptors. EXAMPLES
The following example shows an ffm mount of a_file on b_file. If the du command were executed, its display would show a_file in the file system column and b_file in the Mounted on column: # mount -t ffm a_file b_file The following example shows an ffm mount of a_file on b_file, with the mount -o clone option specifying that a_file is a clone of b_file. # mount -t ffm -o clone a_file b_file RESTRICTIONS
The user process must be the root user or must be the owner of the files and must have write permissions for the files. [Tru64 UNIX] Before you can use the ffm file system, you must configure the kernel option FFM_FS into the kernel. See System Administra- tion for information about configuring the kernel. RELATED INFORMATION
Commands: fdetach(8), mount(8) Functions: fattach(3), fdetach(3), isastream(3), chmod(2), mount(2) Interfaces: streamio(7) Files: fstab(4) Standards: standards(5) delim off ffm(4)

Check Out this Related Man Page

fattach(3)						     Library Functions Manual							fattach(3)

NAME
fattach - Attaches a STREAMS-based file descriptor to a file in the file system name space LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <stropts.h> int fattach( int fd, const char *path); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fattach(): XSH5.0 Refer to standards(5) for more information about industry standards and associated tags. PARAMETERS
Specifies a valid open file descriptor that is associated with a STREAMS file. Specifies the pathname of an existing regular file or directory. DESCRIPTION
The fattach() function associates a STREAMS-based file descriptor to the file pointed to by the path parameter. A successful call to the fattach() function causes all pathnames that name the file named by the path parameter to name the STREAMS file associated with the fd parameter until the STREAMS file is detached from the file. The STREAMS file is detached from the file by using the fdetach() function. A STREAMS file can be attached to more than one file and can have several pathnames associated with it. The attributes of the named STREAMS file are initialized as follows: The group ID, user ID, times, and permissions are set to those of the file pointed to by the path parameter. The number of links is set to 1. The size and the device identifier are set to those of the STREAMS file that is associated with the fd parameter. If any of the attributes of the named STREAMS file are subsequently changed, for example by the chmod() function, the change affects nei- ther the attributes of the underlying file nor the attributes of the STREAMS file to which the fd parameter refers. Any file descriptors referring to the underlying file that were opened prior to an fattach() call continue to refer to the underlying file. The fattach() function uses the File-on-File Mounting (FFM) file system. Instead of mounting a file system on a mount point, the fattach() function ffm mounts a file descriptor on a mount point, which can be either a directory or a regular file. See ffm(4). RETURN VALUES
Upon successful completion, the fattach() function returns a value of 0 (zero). Otherwise, it returns a value of -1, and errno is set to indicate the error. ERRORS
If any of the following conditions occurs, the fattach() function sets errno to the value that corresponds to the condition. Although the user is the owner of path, the user has no write permissions for it, or the object designated by fd is locked. The fd parame- ter is an invalid file descriptor. The existing object specified by the path parameter is already mounted or has a STREAMS file descriptor attached to it. [Tru64 UNIX] The path parameter points to a location outside of the allocated address space of the process. The fd parameter refers to a socket and not a STREAMS file. [Tru64 UNIX] The superblock for the file system had an incorrect magic number or an out of range block size. [Tru64 UNIX] The pathname is incorrect. When path was translated, too many symbolic links were found. [Tru64 UNIX] There are too many file descriptors attached (system-wide). An element of the path parameter does not exist or is an empty string. [Tru64 UNIX] The system resources have been exhausted. The directory portion of the path parameter does not exist. [Tru64 UNIX] The size of a pathname component is longer than NAME_MAX when _POSIX_NO_TRUNC is in effect. The pathname length is longer than PATH_MAX or the length of the intermediate result of a pathname resolution of a symbolic link is longer than PATH_MAX. The current effective user ID is not the owner of the existing file specified by the path parameter. Another cause of the error is if the current effective user ID does not specify a user with the correct privileges. A link to a file on another file system has been attempted. EXAMPLES
The following example shows a program that attaches a STREAMS file to a regular file and results in a df display that indicates the File- on-File Mounting (FFM) is the mounted file system. #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <stropts.h> #include <stdio.h> #include <errno.h> #include <unistd.h> main (int argc, char **argv) { int fd; int error; if ((fd = open("/tmp/astream", O_RDONLY, 0)) == -1) { perror ("open"); exit(error); } printf("opened0); if ((error = isastream(fd)) != 1) { printf("not a stream0); if (error == -1) perror("isastream"); exit(-1); } printf("is a stream0); if ((error = fattach(fd, "/tmp/afile")) == -1) { perror ("fattach"); exit(error); } printf("fattached0); exit(0); } % df /tmp/afile Filesystem 512-blocks Used Available Capacity Mounted on file-on-file mount 0 0 0 100% /tmp/afile RESTRICTIONS
[Tru64 UNIX] The fattach() function requires that the FFM_FS kernel option be configured. See System Administration for information on configuring kernel options. RELATED INFORMATION
Functions: fdetach(3), isastream(3), chmod(2), stat(2), mount(2) Commands: fdetach(8) Interfaces: streamio(7) Files: ffm(4) Standards: standards(5) delim off fattach(3)
Man Page