开发者

How can a program measure device size in AIX?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜