Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#95 closed defect (fixed)

Process check may fail on OpenBSD

Reported by: rainer Owned by: rainer
Priority: major Milestone: 2.4.4
Component: main Version: 2.4.3
Keywords: Cc:

Description

OpenBSD has a bug/misfeature of the C library, such that it mucks about file descriptors 0 to 2 (stdin, stdout, stderr) if an fgetc() for another file (descriptor) is done. Note that the following ktrace is within an fgets() call for the file opened with fd 5, yet it does a fcntl(0,F_SETFL,O_NONBLOCK) on stdin (wtf?!?). The net result is an unexpected value of errno on return of fgets().

 14094 samhain  1206835399.303653 CALL  fcntl(0,0x4,0x4)
 14094 samhain  1206835399.303660 RET   fcntl -1 errno 19 Operation not supported by device
 14094 samhain  1206835399.303666 CALL  fcntl(0x1,0x4,0x6)
 14094 samhain  1206835399.303671 RET   fcntl 0
 14094 samhain  1206835399.303674 CALL  fcntl(0x2,0x4,0x6)
 14094 samhain  1206835399.303678 RET   fcntl 0
 14094 samhain  1206835399.303682 CALL  fcntl(0x5,0x4,0x6)
 14094 samhain  1206835399.303686 RET   fcntl 0

This problem was reported by Roman R., who kindly supplied the ktrace.

Change History (1)

comment:1 Changed 14 years ago by rainer

Resolution: fixed
Status: newclosed

Fixed in changeset [169].

Note: See TracTickets for help on using tickets.