Lines Matching refs:device

38  *	devfree()	Free a reserved device
87 * getlocks() Get the device locks from the device-lock file
88 * islocked() Determines if a device is locked
89 * putlocks() Close the device locks w/ update
90 * freelkfile() Close the device locks w/o updating
101 static char *islocked(char *); /* Determines if a device is locked */
116 * Determines the pathname of the device reservation table file
161 * The _openlkfile() function opens a device-reservation table file
202 * Function closes the device-reservation table file and sets the
211 * lkfilefd The device reservation table file's file descriptor
235 * This function locks the device lock file. If the request cannot
324 * The readlocks() function reads the reserved-device list from
325 * the reserved-device file (which has already been opened)
382 * the allocated buffer. Also, the device lock file is open and
491 * Write device locking information to the device locking file.
494 * key Key the device is being locked on
495 * alias The device alias being locked
502 * lkfilefd The open file descriptor for the open device
536 * lockcount Number of locks in the device lock list
537 * locklist The device lock list
592 * This function unlocks the OA&M device locking file.
626 * This function updates the file containing OA&M device locks.
629 * newlist The address of the list of addresses of device
638 * lockcount Number of locks in the locked device structure
639 * locklist Locked device structure
649 char **pp; /* Pointer into the device list */
708 * char *islocked(device)
709 * char *device
711 * This function checks a device to see if it is locked. If it is
712 * not locked, it returns the device alias.
714 * A device is not locked if the device's alias does not appear in
715 * the device locks table, or the key on which the device was locked
719 * char *device The device to be reserved. This can be
720 * a pathname to the device or a device
724 * Returns a pointer to the device alias if it's not locked, or
728 * struct devlks *locklist Pointer to the list of device locks
733 islocked(char *device)
736 char *alias; /* Alias of "device" */
738 int locked; /* TRUE if device in locked list */
741 /* Get the device's alias */
742 if (alias = devattr(device, DTAB_ALIAS)) {
745 * Look through the device locks to see if this device alias
763 } /* devattr() failed, no such device? */
765 /* Return pointer to the device */
770 * int unreserv(key, device)
772 * char *device
774 * This function removes a device reservation.
777 * int key The key on which the device was allocated
778 * char *device The device to be freed.
785 * to determine if a device is allocated without having the
788 * EINVAL The device specified was not locked
789 * EPERM The device specified was locked but not on the
794 * lockcount Number of entries in the locked-device list
798 unreserv(int key, char *device)
803 struct devlks *plk; /* Pointer to a device lock */
804 int locked; /* TRUE if device currently locked */
814 * Get the device alias. If none can be found, try to free
816 * that the device has been removed from the device table since
817 * it was reserved, so the device not being in the table shouldn't
822 if (alias = devattr(device, DTAB_ALIAS)) srchalias = alias;
825 srchalias = device;
828 /* Loop through the locked-device list looking for what we've got... */
840 /* If the device is locked ... */
856 /* The device isn't locked. Set errno to EINVAL */
871 * Management family of functions. Once a device is reserved, it can't
876 * The function attempts to reserve a single device from each of the
878 * reserve a requested device. If it successfully reserved a device
879 * from each of the lists, it updates the device-locked file and
885 * int key The key on which this device is being reserved.
902 int key, /* Key to reserve device on */
915 int foundone; /* Found a valid device in the list */
933 /* Try to reserve a device from each list */
939 * Check the next device in the list. If islocked()
940 * returns that device's alias, it's ours to have
966 * If no device from the list could be reserved,
1017 * int devfree(key, device)
1019 * char *device
1021 * This function unreserves (frees) the given device. It returns
1026 * int key The key that the device is locked on
1027 * char *device The device (alias, pathname to, etc.) to be freed.
1035 int key, /* Key device is locked on */
1036 char *device) /* Device to free */
1047 /* Attempt to unreserve the device */
1048 if (unreserv(key, device)) {
1058 } else noerr = FALSE; /* Couldn't unreserve the device */