开发者

open limitation based on file size

Is there any limitation on "open" based on file size. ? My file size is 2 GB will it open successfull开发者_StackOverflowy and is there any timing issue can come ? filesystem is rootfs.


From the open man page:

O_LARGEFILE

(LFS) Allow files whose sizes cannot be represented in an off_t (but can be represented in an off64_t) to be opened. The _LARGEFILE64_SOURCE macro must be defined in order to obtain this definition. Setting the _FILE_OFFSET_BITS feature test macro to 64 (rather than using O_LARGEFILE) is the preferred method of obtaining method of accessing large files on 32-bit systems (see feature_test_macros(7)).

On a 64-bit system, off_t will be 64 bits and you'll have no problem. On a 32-bit system, you'll need the suggested workaround to allow for files larger than 2 GB.


rootfs may not support large files; consider using a proper filesystem instead (tmpfs is almost the same as rootfs, but with more features).

rootfs is intended only for booting and early use.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜