diff options
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 99e3de7..d5bb510 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -447,7 +447,12 @@ _lseek (int fd, off_t pos, int dir) off_t res; sigframe thisframe (mainthread); - if (fdtab.not_open (fd)) + if ( dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END ) + { + set_errno ( EINVAL ); + res = -1; + } + else if (fdtab.not_open (fd)) { set_errno (EBADF); res = -1; |