fehQlibs
26
Qlibs
Loading...
Searching...
No Matches
fehQlibs-26
src
lock.c
Go to the documentation of this file.
1
#include <unistd.h>
2
#include <sys/types.h>
3
#include <sys/file.h>
4
#include <fcntl.h>
5
#include "
lock.h
"
6
14
#ifdef HASFLOCK
15
int
lock_ex
(
int
fd) {
return
flock(fd,LOCK_EX); }
16
int
lock_exnb
(
int
fd) {
return
flock(fd,LOCK_EX | LOCK_NB); }
17
int
lock_un
(
int
fd) {
return
flock(fd,LOCK_UN); }
18
#else
19
int
lock_ex
(
int
fd) {
return
lockf(fd,1,0); }
20
int
lock_exnb
(
int
fd) {
return
lockf(fd,2,0); }
21
int
lock_un
(
int
fd) {
return
lockf(fd,0,0); }
22
#endif
lock_exnb
int lock_exnb(int fd)
Definition:
lock.c:20
lock_un
int lock_un(int fd)
Definition:
lock.c:21
lock_ex
int lock_ex(int fd)
Definition:
lock.c:19
lock.h
Generated on Sat Nov 2 2024 13:01:06 for fehQlibs by
1.9.6