I am using statvfs to check the filesystem, and I have difficulties understanding how the following snippet works:
#include <sys/statvfs.h>
struct statvfs aStructure;
int output = statvfs(aPath, &aStructure);
- I include the header. This is the only line that's 100% clear to me here.
- I make aStructure of the type statvfs.
- I call statvfs with aPath and the structure from the previous step.
In 2. statvfs was a structure, in 3. it appears to be a function returning an int.
Is statvfs(aPath, &aStructure) the statvfs constructor and if so, how come aStructure didn't need the constructor or are these two different statvfs?
Thank you for helping me untangle my misunderstanding.