diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-27 01:30:43 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-27 01:30:43 +0800 |
commit | d1f3e1991d8a79317f421125f5bb61e1c5d79474 (patch) | |
tree | 5fbde1bcdf8f700c8272b559b129bdec6324de16 /src/libbbsutil/lock.c | |
parent | b27ece46a69aa7d5b9a759a2164609dab689f258 (diff) | |
download | pttbbs-d1f3e1991d8a79317f421125f5bb61e1c5d79474.tar pttbbs-d1f3e1991d8a79317f421125f5bb61e1c5d79474.tar.gz pttbbs-d1f3e1991d8a79317f421125f5bb61e1c5d79474.tar.bz2 pttbbs-d1f3e1991d8a79317f421125f5bb61e1c5d79474.tar.lz pttbbs-d1f3e1991d8a79317f421125f5bb61e1c5d79474.tar.xz pttbbs-d1f3e1991d8a79317f421125f5bb61e1c5d79474.tar.zst pttbbs-d1f3e1991d8a79317f421125f5bb61e1c5d79474.zip |
(internal) drop src directory (moved to common/ now)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4028 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'src/libbbsutil/lock.c')
-rw-r--r-- | src/libbbsutil/lock.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/libbbsutil/lock.c b/src/libbbsutil/lock.c deleted file mode 100644 index 4b28bab1..00000000 --- a/src/libbbsutil/lock.c +++ /dev/null @@ -1,23 +0,0 @@ -#include <fcntl.h> -#include <unistd.h> -#include <errno.h> - -/** - * lock fd - * @param mode F_WRLCK, F_UNLCK - */ -void -PttLock(int fd, int start, int size, int mode) -{ - static struct flock lock_it; - int ret; - - lock_it.l_whence = SEEK_CUR;/* from current point */ - lock_it.l_start = start; /* -"- */ - lock_it.l_len = size; /* length of data */ - lock_it.l_type = mode; /* set exclusive/write lock */ - lock_it.l_pid = 0; /* pid not actually interesting */ - while ((ret = fcntl(fd, F_SETLKW, &lock_it)) < 0 && errno == EINTR) - sleep(1); -} - |