I have a filesystem that should be mounted with the prjquota
flag. But due to human factors, someone might forget to do that, so I need to check that quota was enabled on application startup. I thought that it's possible to check using quotactl with Q_GETFMT
as the subcmd argument. But it always sets the flag to 0. What am I doing wrong?
I've tried device
as an absolute path to the file under XFS and as a path to the actual device. But no results.
bool isQuotaEnabled(const std::filesystem::path &device)
{
uint32_t buff{};
quotactl(QCMD(Q_GETFMT, PRJQUOTA), device.c_str(), 0, (caddr_t)&buff);
return buff;
}
PRJQUOTA
is for project quota. Replace it with the one you need.