Lines Matching refs:a_fd

180 static FINDLOCK_T	lock_acquire(LOCK_T *a_lock, int *a_fd, char *a_root,
184 static int lock_release(int a_fd, char *a_key, char *a_object,
186 static int lock_status(int a_fd, char *a_key, char *a_object,
193 int a_fd, char *a_object, char *a_key);
194 static int _decrementLockCount(int a_fd, LOCK_T *a_theLock);
195 static int _addLock(char *r_key, int a_fd, char *a_object,
197 static int _incrementLockCount(int a_fd, LOCK_T *a_theLock);
198 static FINDLOCK_T _lock_acquire(LOCK_T *a_lock, int a_fd, char *a_key,
205 static boolean_t _validateLock(int a_fd, LOCK_T *a_theLock, int a_quiet);
598 * a_fd - file descriptor opened on the lock file
618 lock_acquire(LOCK_T *a_theLock, int *a_fd, char *a_root, char *a_key,
633 if ((*a_fd) < 0) {
634 (*a_fd) = _openLockFile(a_altRoot);
635 if ((*a_fd) < 0) {
650 result = _lock_acquire(a_theLock, *a_fd, a_key, a_object,
661 (void) close(*a_fd);
662 *a_fd = -1;
676 (void) close(*a_fd);
677 *a_fd = -1;
707 (void) close(*a_fd);
708 *a_fd = -1;
728 (void) close(*a_fd);
729 *a_fd = -1;
755 (void) close(*a_fd);
763 *a_fd = _openLockFile(a_root);
764 if (*a_fd < 0) {
771 (void) close(*a_fd);
772 *a_fd = -1;
784 * a_fd - file descriptor opened on the lock file
794 lock_release(int a_fd, char *a_key, char *a_object, int a_quiet)
807 result = _findLock(&theLock, &recordNum, a_fd, a_object, a_key);
867 (void) _decrementLockCount(a_fd, &theLock);
885 * a_fd - file descriptor opened on the lock file
895 lock_status(int a_fd, char *a_key, char *a_object, int a_quiet)
919 for (; pread(a_fd, pld, pls, pls*recordNum) == pls; recordNum++) {
984 * a_fd - file descriptor opened on the lock file
995 _lock_acquire(LOCK_T *a_theLock, int a_fd, char *a_key,
1011 result = _findLock(a_theLock, &recordNum, a_fd, a_object,
1018 if (_validateLock(a_fd, a_theLock, a_quiet) == B_TRUE) {
1071 if (_incrementLockCount(a_fd, a_theLock) == 0) {
1088 if (_addLock(key, a_fd, a_object, a_exclusive,
1132 if (_incrementLockCount(a_fd, a_theLock) == 0) {
1606 * a_fd - file descriptor opened on the lock file
1621 int a_fd, char *a_object, char *a_key)
1650 pos = lseek(a_fd, 0L, SEEK_SET);
1659 for (; pread(a_fd, pld, pls, pls*recordNum) == pls; recordNum++) {
1719 * a_fd - file descriptor opened on the lock file
1732 _addLock(char *r_key, int a_fd, char *a_object, int a_exclusive, pid_t a_pid,
1746 pos = lseek(a_fd, 0L, SEEK_END);
1778 result = pwrite(a_fd, &theLock, LOCK_SIZE, pos);
1794 _incrementLockCount(int a_fd, LOCK_T *a_theLock)
1820 result = pwrite(a_fd, pld, pls, pll->lockRecordNum*pls);
1843 * Arguments: a_fd - file descriptor opened on the lock file
1851 _validateLock(int a_fd, LOCK_T *a_theLock, int a_quiet)
1900 _decrementLockCount(a_fd, a_theLock);
1906 _decrementLockCount(int a_fd, LOCK_T *a_theLock)
1935 result = pwrite(a_fd, pld, pls, pll->lockRecordNum*pls);
1958 lastPos = lseek(a_fd, 0L, SEEK_END); /* get size of lock file */
1985 res = ftruncate(a_fd, lastPos-pls);
2008 result = pread(a_fd, tmpLock._lrLockData, pls, lastRecord*pls);
2021 res = ftruncate(a_fd, lastPos-pls);
2037 result = pwrite(a_fd, tmpLock._lrLockData, pls, pll->lockRecordNum*pls);