Lots of these things like EAGAIN aren't really "errors", somebody doing that would be expected to handle this situation. aysnc read/write is common in realtime systems.

Some of these things like EFAULT, can't be done as a user (O/S) won't allow it.

One simple idea for you is to setup some I/O intensive thing on a flash drive. Then reach down and unplug that thing. This will look like disk drive died midstream and some kind of error will happen. Depending upon file system, timing of this, etc. the result might be even complete loss of all data on that stick. But if it formatted to look like a hard drive, then I think you can set up (maybe with a few ties) something like looks like EIO (bad sector) because the "checksum" for that sector will be wrong. If I'm right, then you have a known bad file on a "disk drive" that you can test with. Setup up loop with write intensive thing, unplug drive, then see if you can read all files after you reset program, replug in and try reading. May take a couple of tries to hit this right and get desire effect.


In reply to Re^2: Generating a readline error by Marshall
in thread Generating a readline error by ikegami

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.