Print only the complete information if the fd is valid itself (in is_valid_fd).
[reactos.git] / reactos / lib / crt / io / locking.c
1 #include "precomp.h"
2 #include <io.h>
3 #include <internal/file.h>
4
5
6 /*
7 * @implemented
8 */
9 int _locking(int _fd, int mode, long nbytes)
10 {
11 long offset = _lseek(_fd, 0L, 1);
12 if (offset == -1L)
13 return -1;
14 if (!LockFile((HANDLE)_get_osfhandle(_fd),offset,0,nbytes,0)) {
15 _dosmaperr(GetLastError());
16 return -1;
17 }
18
19 return 0;
20 }