My C program mounts a raw device, then lseeks to its end to find the length. This works well in Linux and Wi开发者_如何学Gondows, but fails in AIX - apparently you can seek to any location, even past the end. Any idea on how to do it correctly in C?
I've never used AIX, but have you tried using read
. It may fail either at or past the end, so you could do binary search for the end using seek
and read
, maybe.
精彩评论