bytecodealliance / userfaultfd-rs

Rust bindings for the Linux userfaultfd functionality
Apache License 2.0
43 stars 22 forks source link

Check for the correct EOF value from read(2). #21

Closed sunfishcode closed 3 years ago

sunfishcode commented 3 years ago

read(2) returns 0 on EOF, rather than libc::EOF.

This also matches the EOF check done in the userfaultfd example.

I haven't observed EOF on a userfaultfd occurring in an actual use; this is just something I noticed while reading the code.