Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 3: Extended Library Functions Oracle Solaris 10 1/13 Information Library |
Extended Library Functions - Part 1
Extended Library Functions - Part 2
Extended Library Functions - Part 3
gl_customize_completion(3TECLA)
HBA_GetAdapterAttributes(3HBAAPI)
HBA_GetAdapterPortAttributes(3HBAAPI)
HBA_GetBindingCapability(3HBAAPI)
HBA_GetBindingSupport(3HBAAPI)
HBA_GetDiscoveredPortAttributes(3HBAAPI)
HBA_GetFcpPersistentBinding(3HBAAPI)
HBA_GetFcpTargetMapping(3HBAAPI)
HBA_GetFcpTargetMappingV2(3HBAAPI)
HBA_GetNumberOfAdapters(3HBAAPI)
HBA_GetPersistentBindingV2(3HBAAPI)
HBA_GetPortAttributesByWWN(3HBAAPI)
HBA_GetPortStatistics(3HBAAPI)
HBA_GetVendorLibraryAttributes(3HBAAPI)
HBA_GetWrapperLibraryAttributes(3HBAAPI)
HBA_RefreshAdapterConfiguration(3HBAAPI)
HBA_RefreshInformation(3HBAAPI)
HBA_RegisterForAdapterAddEvents(3HBAAPI)
HBA_RegisterForAdapterEvents(3HBAAPI)
HBA_RegisterForAdapterPortEvents(3HBAAPI)
HBA_RegisterForAdapterPortStatEvents(3HBAAPI)
HBA_RegisterForLinkEvents(3HBAAPI)
HBA_RegisterForTargetEvents(3HBAAPI)
HBA_RemoveAllPersistentBindings(3HBAAPI)
HBA_RemovePersistentBinding(3HBAAPI)
HBA_ScsiReadCapacityV2(3HBAAPI)
HBA_SetBindingSupport(3HBAAPI)
HBA_SetPersistentBindingV2(3HBAAPI)
IFDHCreateChannelByName(3SMARTCARD)
IFDHGetCapabilities(3SMARTCARD)
IFDHSetCapabilities(3SMARTCARD)
IFDHSetProtocolParameters(3SMARTCARD)
MP_AssignLogicalUnitToTPG(3MPAPI)
MP_DeregisterForObjectPropertyChanges(3MPAPI)
MP_DeregisterForObjectVisibilityChanges(3MPAPI)
MP_DisableAutoFailback(3MPAPI)
Extended Library Functions - Part 4
- convert a supplied name into an absolute pathname that can be used to access removable media
cc [ flag ... ] file ... -lvolmgt [ library ... ] #include <volmgt.h> char *media_findname(char *start);
media_findname() converts the supplied start string into an absolute pathname that can then be used to access a particular piece of media.
The start parameter can be one of the following types of specifications:
An absolute pathname in /dev, such as /dev/rdiskette0, in which case a copy of that string is returned (see NOTES on this page).
An absolute Volume Management pathname, such as /vol/dev/aliases/floppy0 or /vol/dsk/fred. If this supplied pathname is not a symbolic link, then a copy of that pathname is returned. If the supplied pathname is a symbolic link then it is dereferenced and a copy of that dereferenced pathname is returned.
The Volume Management volume name for a particular volume, such as fred (see fdformat(1) for a description of how to label floppies). In this case a pathname in the Volume Management namespace is returned.
The Volume Management symbolic name for a device, such as floppy0 or cdrom2 (see volfs(7FS) for more information on Volume Management symbolic names), in which case a pathname in the Volume Management namespace is returned.
The Volume Management generic media type name. For example, floppy or cdrom. In this case media_findname() looks for the first piece of media that matches that media type, starting at 0 (zero) and continuing on until a match is found (or some fairly large maximum number is reached). In this case, if a match is found, a copy of the pathname to the volume found is returned.
Upon successful completion media_findname() returns a pointer to the pathname found. In the case of an error a null pointer is returned.
For cases where the supplied start parameter is an absolute pathname, media_findname() can fail, returning a null string pointer, if an lstat(2) of that supplied pathname fails. Also, if the supplied absolute pathname is a symbolic link, media_findname() can fail if a readlink(2) of that symbolic link fails, or if a stat(2) of the pathname pointed to by that symbolic link fails, or if any of the following is true:
The specified absolute pathname was not a character special device, and it was not a directory with a character special device in it.
Example 1 Sample programs of the media_findname() function.
The following example attempts to find what the Volume Management pathname is to a piece of media called fred. Notice that a volmgt_check() is done first (see the NOTES section on this page).
(void) volmgt_check(NULL); if ((nm = media_findname("fred")) != NULL) { (void) printf("media named \"fred\" is at \"%s\"\n", nm); } else { (void) printf("media named \"fred\" not found\n"); }
This example looks for whatever volume is in the first floppy drive, letting media_findname() call volmgt_check() if and only if no floppy is currently known to be the first floppy drive.
if ((nm = media_findname("floppy0")) != NULL) { (void) printf("path to floppy0 is \"%s\"\n", nm); } else { (void) printf("nothing in floppy0\n"); }
See attributes(5) for descriptions of the following attributes:
|
cc(1B), fdformat(1), vold(1M), lstat(2), readlink(2), stat(2), free(3C), malloc(3C), volmgt_check(3VOLMGT), volmgt_inuse(3VOLMGT), volmgt_root(3VOLMGT), volmgt_running(3VOLMGT), volmgt_symname(3VOLMGT), attributes(5), volfs(7FS)
If media_findname() cannot find a match for the supplied name, it performs a volmgt_check(3VOLMGT) and tries again, so it can be more efficient to perform volmgt_check() before calling media_findname().
Upon success media_findname() returns a pointer to string which has been allocated; this should be freed when no longer in use (see free(3C)).