summaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/generic/sys-file-stubs.cpp
blob: e1cc9ab21b0d06a06f539a02a1ecb9245baf3545 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#include <sys/file.h>
#include <mlibc/posix-sysdeps.hpp>
#include <errno.h>

#include <bits/ensure.h>

int flock(int fd, int opt) {
	MLIBC_CHECK_OR_ENOSYS(mlibc::sys_flock, -1);
	if(int e = mlibc::sys_flock(fd, opt); e) {
		errno = e;
		return -1;
	}
	return 0;
}