From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 9 20:40:46 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 101DF16A418 for ; Sat, 9 Feb 2008 20:40:46 +0000 (UTC) (envelope-from yngwiie@bk.ru) Received: from mx28.mail.ru (mx28.mail.ru [194.67.23.67]) by mx1.freebsd.org (Postfix) with ESMTP id C540113C4D1 for ; Sat, 9 Feb 2008 20:40:45 +0000 (UTC) (envelope-from yngwiie@bk.ru) Received: from mx27.mail.ru (mx27.mail.ru [194.67.23.23]) by mx28.mail.ru (mPOP.Fallback_MX) with ESMTP id 6C7D731C27C for ; Sat, 9 Feb 2008 23:02:22 +0300 (MSK) Received: from [89.252.214.155] (port=60536 helo=dune) by mx27.mail.ru with asmtp id 1JNvu0-000Inv-00 for freebsd-hackers@freebsd.org; Sat, 09 Feb 2008 23:02:20 +0300 Date: Sat, 9 Feb 2008 22:02:06 +0200 From: Ivan Georgiev To: freebsd-hackers@freebsd.org Message-Id: <20080209220206.695e5d9b.yngwiie@bk.ru> Organization: Ivan Georgiev X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.7; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: quotactl returns double values X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2008 20:40:46 -0000 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