Hello,

I was just playing, trying to see how quotactl works,
but in all my tries the values returned are doubled,
here is an example:

#include
#include
#include
#include
#include

int main(int argc, char* argv[]) {

struct dqblk *my_st;
const char* path = "/usr";
int uid;

my_st = malloc(sizeof(struct dqblk));
uid = atoi(argv[1]);

if((quotactl(path,QCMD(Q_GETQUOTA,USRQUOTA),uid,my _st)) < 0) {
free(my_st);
perror("error");
exit(-1);
}

printf("User Hard Limit : %d\n \
Actual Usage : %d\n", my_st->dqb_bhardlimit, \
my_st->dqb_curblocks);

free(my_st);

return 0;
}

the values stored in my_st->dqb_bhardlimit and my_st->dqb_curblocks
are the real values times two, the hard limit on the user is 102400K,
but my_st->dqb_bhardlimit holds 204800K.

Could someone please tell me what i am doing wrong.
Thanks in advance.

Regards:
Ivan
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/lis...reebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"