View Single Post
  #3   (View Single Post)  
Old 13th April 2009
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Thanks ephemera, that was a good idea. I tried lseek, and in a quick test (for count=9 again) it gave the expected result:

Code:
$ ltrd
where = 0
where = 0
1:  nr = 2352
2:  nr = 2352
3:  nr = 2352
4:  nr = 2352
5:  nr = 2352
6:  nr = 2352
7:  nr = 2352
8:  nr = 2352
9:  nr = 0
BTW, I had also tried fseeko(3), and it had the same problem as fseek(3). I'm still puzzled why fseek doesn't work with read(2), as they both seem to be rather legacy functions of this kind.

As for FreeBSD, I don't have it installed and never used it, so I don't know if the results are the same there. If any of the local FreeBSD users wish to try it and report the result that would be interesting!
Reply With Quote