Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mount(S) — OpenDesktop Software Development System 1.0.0d

Media Vault

Software Library

Restoration Projects

Artifacts Sought



     MOUNT(S)                  UNIX System V                  MOUNT(S)



     Name
          mount - mount a file system

     Syntax
          #include <sys/types.h>
          #include <sys/mount.h>

          int mount (spec, dir, mflag, fstyp, dataptr, datalen)
          char *spec, *dir;
          int mflag, fstyp;
          char *dataptr;
          int datalen;

     Description
          mount requests that a removable file system contained on the
          block special file identified by spec be mounted on the
          directory identified by dir.  spec and dir are pointers to
          path names.  fstyp is the file system type number.  The
          sysfs(S) system call can be used to determine the file
          system type number.  Note that if both the MS_DATA and
          MS_FSS flag bits of mflag are off, the file system type will
          default to the root file system type.  Only if either flag
          is on will fstyp be used to indicate the file system type.

          If the MS_DATA flag is set in mflag, the system expects the
          dataptr and datalen arguments to be present.  Together they
          describe a block of file-system specific data at address
          dataptr of length datalen.  This is interpreted by file-
          system specific code within the operating system and its
          format depends upon the file system type.  A particular file
          system type may not require this data, in which case dataptr
          and datalen should both be zero.  Note that MS_FSS is
          obsolete and will be ignored if MS_DATA is also set, but if
          MS_FSS is set and MS_DATA is not, dataptr and datalen are
          both assumed to be zero.

          Upon successful completion, references to the file dir will
          refer to the root directory on the mounted file system.

          The low-order bit of mflag is used to control write
          permission on the mounted file system; if 1, writing is
          forbidden, otherwise writing is permitted according to
          individual file accessibility.

          mount may be invoked only by the super-user.  It is intended
          for use only by the mount(ADM) utility.

          mount will fail if one or more of the following is true:

          [EPERM]        The effective user ID is not super-user.

          [ENOENT]       Any of the named files does not exist.

          [ENOTDIR]      A component of a path prefix is not a
                         directory.

          [EREMOTE]      spec is remote and cannot be mounted.

          [ENOLINK]      path points to a remote machine and the link
                         to that machine is no longer active.

          [EMULTIHOP]    Components of path require hopping to
                         multiple remote machines.

          [ENOTBLK]      spec is not a block special device.

          [ENXIO]        The device associated with spec does not
                         exist.

          [ENOTDIR]      dir is not a directory.

          [EFAULT]       spec or dir points outside the allocated
                         address space of the process.

          [EBUSY]        dir is currently mounted on, is someone's
                         current working directory, or is otherwise
                         busy.

          [EBUSY]        The device associated with spec is currently
                         mounted.

          [EBUSY]        There are no more mount table entries.

          [EROFS]        spec is write-protected and mflag requests
                         write permission.

          [ENOSPC]       The file system state in the super-block is
                         not FsOKAY and mflag requests write
                         permission.

          [EINVAL]       The super-block has an invalid magic number
                         or the fstyp is invalid or mflag is not
                         valid.

     See Also
          sysfs(S), umount(S), mount(ADM), fs(F)

     Diagnostics
          Upon successful completion a value of 0 is returned.
          Otherwise, a value of -1 is returned, and errno is set to
          indicate the error.

     Standards Conformance
          mount is conformant with:
          AT&T SVID Issue 2, Select Code 307-127;
          and The X/Open Portability Guide II of January 1987.


                                             (printed 6/20/89)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026