views:

26

answers:

2

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

+3  A: 

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.

Thomas
+2  A: 

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.

MarkR