xref: /haiku/src/system/libroot/posix/sys/flock.c (revision 43711de9d2e6df4f0270c4b531d7b93c36e9b5fc)
1 /*
2  * Copyright 2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <syscalls.h>
8 
9 #include <sys/file.h>
10 #include <errno.h>
11 
12 
13 int
14 flock(int fd, int op)
15 {
16 	status_t status = _kern_flock(fd, op);
17 	if (status < B_OK) {
18 		errno = status;
19 		return -1;
20 	}
21 
22 	return 0;
23 }
24 
25