id summary reporter owner description type status priority milestone component version severity resolution keywords cc 273 fcntl() fails Silvan Scherrer Silvan Scherrer "given this code: {{{ fl.l_type = rw; fl.l_whence = SEEK_SET; fl.l_start = off; fl.l_len = len; fl.l_pid = 0; if (waitflag) return fcntl(tdb->fd, F_SETLKW, &fl); else return fcntl(tdb->fd, F_SETLK, &fl); }}} where len == 0 and off == 692 libc produces this log: {{{ 014759df 01 04 0004 Entr 0000 __fcntl_locking: fh=3 iRequest=9 pFlock=0x025bedf8 014759df 01 04 0004 ErrL 0000 __fcntl_locking (0 ms): D:/CODING/LIBC/0.6/src/emx/src/lib/sys/b_ioFileControl.c(334): 014759df 01 04 0004 ErrL 0000: ret -EINVAL - Invalid offStart=2b4 cbRange=7fffffffffffffff 014759df 01 03 0004 ErrL 0000 __libc_Back_ioFileControlStandard (0 ms): D:/CODING/LIBC/0.6/src/emx/src/lib/sys/b_ioFileControl.c(178): }}} i guess this libc check is wrong: {{{ if ( offStart < 0 || cbRange + offStart < 0) LIBCLOG_ERROR_RETURN_MSG(-EINVAL, ""ret -EINVAL - Invalid offStart=%llx cbRange=%llx\n"", offStart, cbRange); }}} in the case that cbRange is OFF_MAX the check should also succeed." defect closed highest libc-0.6.6 libc blocker fixed