| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- get mounted device information
#include <stdio.h>#include <sys/mnttab.h>intgetmntent(FILE *fp,struct mnttab *mp);
intgetmntany(FILE *fp,struct mnttab *mp,struct mnttab *mpref);
intgetextmntent(FILE *fp,struct extmnttab *mp,intlen);
char *hasmntopt(struct mnttab *mnt,char *opt);
intputmntent(FILE *iop,struct mnttab *mp);
voidresetmnttab(FILE *fp);
Thegetmntent() andgetmntany() functions each fill in the structure pointed tobymp with the broken-out fields of a line in themnttabfile. Each line read from the file contains amnttab structure, which isdefined in the <sys/mnttab.h> header. The structure contains the following members, whichcorrespond to the broken-out fields from a line in/etc/mnttab (seemnttab(4)).
char *mnt_special; /* name of mounted resource */char *mnt_mountp; /* mount point */char *mnt_fstype; /* type of file system mounted */char *mnt_mntopts; /* options for this mount */char *mnt_time; /* time file system mounted */
Fields with no actual content in/etc/mnttab are represented in the fileas ”-”. To clearly distinguish empty fields,getmntent() set the corresponding fieldinmp toNULL.
Eachgetmntent() call causes a new line to be read from themnttab file. Successive calls can be used to search the entire list.Thegetmntany() function searches the file referenced byfp until a matchis found between a line in the file andmpref. A match occursif all non-null entries inmpref match the corresponding fields in thefile. These functions do not open, close, or rewind the file.
Thegetextmntent() function is an extended version of thegetmntent() function thatreturns, in addition to the information thatgetmntent() returns, the major andminor number of the mounted resource to which the line inmnttabcorresponds. Thegetextmntent() function also fills in theextmntent structure defined inthe <sys/mnttab.h> header. Forgetextmntent() to function properly, it must benotified when themnttab file has been reopened or rewound since apreviousgetextmntent() call. This notification is accomplished by callingresetmnttab(). Otherwise,it behaves exactly asgetmntent() described above
The data pointed to by themnttab structure members are stored ina static area and must be copied to be saved between successivecalls.
Thehasmntopt() function scans themnt_mntopts member of themnttab structuremntfor a substring that matchesopt. It returns the address of thesubstring if a match is found; otherwise it returns0. Substrings aredelimited by commas and the end of themnt_mntopts string.
Theputmntent() function is obsolete and no longer has any effect. Entriesappear inmnttab as a side effect of amount(2) call. The functionname is still defined for transition purposes.
Theresetmnttab() function notifiesgetextmntent() to reload from the kernel the deviceinformation that corresponds to the new snapshot of themnttab information (seemnttab(4)). Subsequentgetextmntent() calls then return correctextmnttab information. This function shouldbe called whenever themnttab file is either rewound or closed andreopened before any calls are made togetextmntent().
If the next entry is successfully read bygetmntent() or a matchis found withgetmntany(),0 is returned. If an EOF isencountered on reading, these functions return-1. If an error is encountered, avalue greater than 0 is returned. The following error values are definedin<sys/mnttab.h>:
A line in the file exceeded the internal buffer size ofMNT_LINE_MAX.
A line in the file contains too many fields.
A line in the file contains too few fields.
Upon successful completion,hasmntopt() returns the address of the substring if amatch is found. Otherwise, it returns0.
Theputmntent() is obsolete and always returns-1.
Seeattributes(5) for descriptions of the following attributes:
|
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |