how can i get the size of a QNX partition(programmaticaly)

i just want to learn the size of any given partition in my program.
do you have any idea?
thanks for your advices…

struct stat64 statBuf;

stats64( “/dev/hd0t77”, &statBuf );

statBuff.st_size should contain the size of the partition.

Or you could use fstatvfs64 to gather more specific information if you need to.

if ( stat64( “…/…/home”, &statBuf ) == -1) {
perror (“stat” );
return EXIT_FAILURE;
} else {
printf (“Free memory: %d bytes\n”, statBuf.st_size);
return EXIT_SUCCESS;
}
when i execute this code , i get always this output : 4096 bytes
what is wrong?

because you didn’t the read the documentation. st_size is a 64 bit value, you need to use %lld.