I have the following expression:
#define GB (1024 * 1024 * 1024)
#define TB (1024 * GB)
#define MAX_SIZE (3 * TB)
off_t current_size;
And then the expression...
if (current_size > MAX_SIZE)
{
//do something
}
I have used large file support in my program. Compiled using -D_FILE_OFFSET_BITS=64 flag.
So, with large file support, off_t grows from 32 to 64 bits.
But how do I compare something which is off_t with a 64 bit number ?? How do I use a 64 bit number in an expression ??
#define MAX_SIZE (3ul * TB) will also fail because ul is still 32 bits.
please help me.. I am looking for a portable solution.. thanks :)))