Report-an-Apple-bug Friday! 8

2006-03-17 03:58:00 -08:00

This bug is kevent does not return EV_EOF when an open regular file reaches EOF. It was filed on 2006-03-17 at 02:27.


Summary:

EVFILT_READ on a regular file never returns an event with the EV_EOF flag set.

Steps to Reproduce:

  1. Create a kqueue.
  2. Open a file for reading.
  3. Add a kevent description to the queue from step 1 with EVFILT_READ and the fd from step 2.
  4. Read until the end of file.
  5. Call kevent.

Expected Results:

The data member of the returned kevent structure has the EV_EOF bit set.

Actual Results:

The data member of the returned kevent structure never has the EV_EOF bit set, so if your app is expecting it, it keeps on polling forever and never closes the file.

Regression:

None known.

Notes:

I also tried calling read and kevent one more time (testing for feof behavior), but still did not get EV_EOF.

A test case is included.


(Note: GeoCities is being cranky today. The test case will be up eventually.)

Technorati tags: , .

One Response to “Report-an-Apple-bug Friday! 8”

  1. Domain of the Bored » Blog Archive » Report-an-Apple-bug Friday! 8 (follow-up) Says:

    […] I got a follow-up to Report-an-Apple-Bug-Friday! 8. I’ve HTMLized it, but otherwise it is unchanged. This is a follow-up to Bug ID# 4481916. We have received the following update regarding your report: […]

Leave a Reply

Do not delete the second sentence.