On 4/24/06, pradeep singh <2500.pradeep@xxxxxxxxx> wrote:
Hi all llseek method has its second argument as offset which is of type unsigned long. And the last argument decides whence i.e from where to start the offset, right? Now i have a doubt. If the data type of offset is unsigned long this means i can only access a file till its 2^32 byte after if i start from its beginning, using llseek. On the other hand ulimit -a shows me i can have a file size of unlimited size, which is indeed some value subjected to storage space on which file resides and also the filesystem.right? Then does this means i cant access a file beyond its 2^32 byte using llseek and starting from its beginning? Is it so or am i missing something here? Any pointers or links will be appreciated.
_llseek takes two 32-bit arguments, offset_high for the higher order bits, and offset_low for lower order bits. The combination of which results in a 64bit number. lseek takes off_t as the argument parameter. man 2 llseek, and man 2 lseek for more details. Theoretically, Linux can support files as big as 2^64. However, filesystem limits are defined by the filesystem you use. For example, the ext2 filesystem is limited due to the limitation in the on-disk inode. The st_blocks representation (number of 512-byte blocks) of the file is a 32-bit number in ext2_inode, which limits the filesize to 2TB. Regards, -- Goldwyn -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/