It’s simple to generate a write error in a test suite by writing to /dev/full. Is there a good technique to generate a read error? I’m currently using LD_PRELOAD to override read but that seems too complicated and non-portable (not that /dev/full is portable…).
It’s simple to generate a write error in a test suite by writing to
Share
Besides reading from a directory (as mentioned in a previous answer) you can try to read
/proc/self/memto get an error (this should get you anEIOon Linux). For an explanation, please see: https://unix.stackexchange.com/a/6302