I am trying to write a large file, but it always stops writing when it hits 2GB. (2147483647 bytes to be exact). I know it's not an O/S or disk issue (I'm on solaris) as I'm able to use the mkfile command to create a 3GB file.

I'm using the SUN workshop compiler. Are you aware of any flags that I can use that will allow writing files that are larger than 2GB?

I was able to figure it out by doing 'man lfcompile', which told me about 'getconf'. I then ran getconf LFS_CFLAGS and got
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

Once I compiled with these flags, I could create files larger than 2 GB.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.