Netatalk utility functions: locking. More...
Functions | |
| int | lock_reg (int fd, int cmd, int type, off_t offset, int whence, off_t len) |
| lock a file with fctnl | |
Netatalk utility functions: locking.
| int lock_reg | ( | int | fd, |
| int | cmd, | ||
| int | type, | ||
| off_t | offset, | ||
| int | whence, | ||
| off_t | len ) |
lock a file with fctnl
This function is called via the macros: read_lock, write_lock, un_lock
| [in] | fd | File descriptor |
| [in] | cmd | cmd to fcntl, only F_SETLK is usable here |
| [in] | type | F_RDLCK, F_WRLCK, F_UNLCK |
| [in] | offset | byte offset relative to l_whence |
| [in] | whence | SEEK_SET, SEEK_CUR, SEEK_END |
| [in] | len | no. of bytes (0 means to EOF) |