This is a copy of my shell interaction: $ ls -l total 13 -rw-r--r-- 1 Dan all 1980 Mar 5 17:56 shortnsweet.c -rw-r--r-- 1 Dan all 10962 Mar 5 17:48 writetest.c $ gcc shortnsweet.c -o shortnsweet $ ./shortnsweet chkwrite:: extra bytes written (according to lseek) supposed to be : 1 byte(s) actual : 2 byte(s) file pos (pre-wr ): 10 file pos (post-wr ): 12 file size (fstat) : 12 $ ls -l tstfile -rw-r--r-- 1 Dan all 16 Mar 5 18:05 tstfile $ gcc writetest.c -o writetest $ ./writetest chkwrite:: extra bytes written (according to lseek) supposed to be : 1 byte(s) actual : 2 byte(s) total bytes written: 11 file pos (pre-wr ): 10 file pos (post-wr ): 12 file size (fstat) : 12 wrote : 0xa read back : 0xa inconsistency:: showing chkread errors: chkread:: too few bytes read (according to return value of read) supposed to be : 2 byte(s) actual : 1 byte(s) file pos (pre-rd) : 10 file pos (post-rd) : 12 read : 0xa examine_inconsistency:: read 1 (extra bytes) bytes:: 0xa examine_inconsistency:: showing chkread errors (intended): chkread:: extra bytes read (according to lseek) supposed to be : 1 byte(s) actual : 2 byte(s) file pos (pre-read): 10 file pos (post-rd) : 12 read : 0xa examine_inconsistency:: showing chkread errors (intended and extra): chkread:: too few bytes read (according to return value of read) supposed to be : 2 byte(s) actual : 1 byte(s) file pos (pre-rd) : 10 file pos (post-rd) : 12 read : 0xa examine_inconsistency:: showing chkread errors (intended and extra+1): chkread:: too few bytes read (according to return value of read) supposed to be : 3 byte(s) actual : 2 byte(s) file pos (pre-rd) : 10 file pos (post-rd) : 13 read : 0xa 0xb read_and_fprint_file:: showing chkread errors (entire file): chkread:: too few bytes read (according to return value of read) supposed to be : 16 byte(s) actual : 15 byte(s) file pos (pre-rd) : 0 file pos (post-rd) : 16 read : 0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe chklseek_then_read_byte:: read 0 at pos 0 chklseek_then_read_byte:: read 0x1 at pos 0x1 chklseek_then_read_byte:: read 0x2 at pos 0x2 chklseek_then_read_byte:: read 0x3 at pos 0x3 chklseek_then_read_byte:: read 0x4 at pos 0x4 chklseek_then_read_byte:: read 0x5 at pos 0x5 chklseek_then_read_byte:: read 0x6 at pos 0x6 chklseek_then_read_byte:: read 0x7 at pos 0x7 chklseek_then_read_byte:: read 0x8 at pos 0x8 chklseek_then_read_byte:: read 0x9 at pos 0x9 chklseek_then_read_byte:: read 0xa at pos 0xa chklseek_then_read_byte:: read 0xa at pos 0xb chklseek_then_read_byte:: read 0xb at pos 0xc chklseek_then_read_byte:: read 0xc at pos 0xd chklseek_then_read_byte:: read 0xd at pos 0xe $ ls -l tstfile -rw-r--r-- 1 Dan all 16 Mar 5 18:07 tstfile