/* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include #include #include int lock(int fd, long offset, long length) { int ret = _dos_lock(fd, offset, length); #if 0 /* __doserr_to_errno does the same */ /* change return code because Borland does it this way */ if (ret == 0x21) ret = EACCES; #endif if (ret != 0) { errno = __doserr_to_errno(ret); return -1; } else return 0; }