aboutsummaryrefslogtreecommitdiff
path: root/include/ulockmgr.h
blob: 4cd7b1c08cd15d712fb68b8d5be98577633e2cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
    libulockmgr: Userspace Lock Manager Library
    Copyright (C) 2006  Miklos Szeredi <miklos@szeredi.hu>

    This program can be distributed under the terms of the GNU LGPL.
    See the file COPYING.LIB.
*/

#include <stdint.h>
#include <fcntl.h>

/**
 * Perform POSIX locking operation
 *
 * @param fd the file descriptor
 * @param cmd the locking command (F_GETFL, F_SETLK or F_SETLKW)
 * @param lock the lock parameters
 * @param owner the lock owner ID cookie
 * @param owner_len length of the lock owner ID cookie
 * @return 0 on success -errno on error
 */
int ulockmgr_op(int fd, int cmd, struct flock *lock, const void *owner,
                size_t owner_len);