Skip to contentSkip to conversation

fcntl returns wrong error code

PATCH [email protected] 1 participant 1 message Mar 26, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines

When fcntl(fd, F_DUPFD, b) is called where 'b' is greater than the maximum allowable value EINVAL should be returned. From POSIX:

"[EINVAL] The cmd argument is invalid, or the cmd argument is F_DUPFD and arg is negative or greater than or equal to {OPEN_MAX}, or ..."

... Also we sort of have a problem since OPEN_MAX is not a constant on Linux x86. I guess that means a libc enforced behaviour or something for that bit

OPEN_MAX is described in the <limits.h> POSIX man page as a runtime invariant constant. However, it is allowed to be indeterminate, so no problems arise, I think.

Andries