getdmapent, getdmapnam, getdmaptype, getdmaptdev, setdmapent, enddmapent, setdmapfile - get device_maps entry
cc [flag...] file... -lbsm [library...]
#include <bsm/devices.h>
devmap_t *getdmapent(void);
devmap_t *getdmapnam(char *name);
devmap_t *getdmapdev(char *name);
devmap_t *getdmaptype(char *type);
void setdmapent(void);
void enddmapent(void);
The getdmapent(), getdmapnam(), getdmapdev(), and getdmaptype() functions each return a device_deallocate entry. The getdmapent() function enumerates all device_maps entries. The getdmaptype() function enumerates device_maps entries with a given device type. Successive calls to these functions return either successive device_maps entries or NULL. The getdmapnam() function searches for a device_maps entry with a given device allocation name. The getdmapdev() function searches for a device_maps entry containing a given device special file.
The internal representation of a device_maps entry is a devmap_t structure defined in <bsm/devices.h> with the following members:
char *dmap_devname; /* device allocation name */ char *dmap_devtype; /* generic device type */ char *dmap_devlist; /* list of associated device special files */
The setdmapent() function "rewinds" to the beginning of the enumeration of device_maps entries. Calls to getdmapnam() may leave the enumeration in an indeterminate state, so setdmapent() should be called before the first call to getdmapent() or getdmaptype().
The enddmapent() function can be called to indicate that device_maps processing is complete. The library can then close any open device_maps file, deallocate any internal storage, and so forth.
The setdmapfile() function changes the pathname used by the other functions for opening the device_maps file, allowing use of device_maps files other than the default file, /etc/security/device_maps.
The getdmapent() and getdmaptype() functions return a pointer to a devmap_t if they successfully enumerate an entry. Otherwise they return NULL, indicating the end of the enumeration.
The getdmapnam() function returns a pointer to a devmap_t if it successfully locates the requested entry. Otherwise it returns NULL.
/etc/security/device_maps
Administrative file defining the mapping of device special files to allocatable device names.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | Unsafe |
allocate(1), free(3C), device_maps(4), attributes(5)
The getdmapent(), getdmapnam(), getdmapdev(), and getdmaptype() functions allocate memory for the pointers they return. This memory can be deallocated with the free(3C) function.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |