quotactl() on OSF/1

quotactl() on OSF/1

Post by Murray S. Kuchera » Wed, 08 Feb 1995 04:33:21

This post refers to OSF/1 v3.0.

I'm trying to set disk quotas for my users using quotactl(), but I'm finding
that if I do:

        struct passwd *pw;
        struct group *gr;
        struct dqblk q;

        gr = getgrnam("customer");
        if (gr == (struct group *)NULL) {
                fprintf(stderr,"Group \"customer\" not defined.\n");

        while ( (pw = getpwent()) != (struct passwd *)NULL ) {
                if (pw->pw_gid == gr->gr_gid) {   /* if it's the right group */
                        (void) memset ((char *)&q,'\0',sizeof(q));
                        q.dqb_bsoftlimit = 2000;
                        q.dqb_bhardlimit = 10000;
                        q.dqb_btime = 3*86400; /* 3 days */
                        fprintf(stdout,"Setting quota for %s\n",pw->pw_name);
                        if (quotactl(pw->pw_dir,QCMD(Q_SETQUOTA,USRQUOTA),
                                pw->pw_uid,&q) < 0)
                                fprintf(stdout,"quotactl(Q_SETQUOTA): %s\n",

It's setting the two quotas correctly, but the grace period that shows
up as output on "quota -v" for someone over quota, either their soft
limit or their hard limit, says "none", and the user is denied more
blocks.  Am I doing something wrong?
Murray S. Kucherawy ==========================================================
Software Manager            HookUp Communication Corporation - Ontario, CANADA

            --- "Intel, where quality is job 0.9999992342" ---


1. Solaris / OSF Quotas - quotactl


Is there an equivalent to quotactl in Solaris ? quotactl is a function which
allows you to manipulate disk quota information in osf and has various related
commands like setquota which if I remember allows you to set quotas on the fly
without relying on (v)edquota.

So is there a function, a series of functions or even a library that I can use
to manipulate quotas within in Solaris - and if there is where's the
documentation ? If not does anyone know anything about the data structure for

I'd be grateful for any information - because the way my program is working
at the moment with 2 system calls to repquota and edquota has to be the
nastiest pieces of code I have ever written !



2. file operations in ip_output.c

3. Learn OSF Technology at the OSF/DCE Conference

4. make question...

5. AMD running on OSF/1 (dec/alpha) version 3.2 run on OSF/1 4.0?

6. Sendmail 8.10.1 and AIX 4.1.5

7. quotactl for Solaris 2.3?

8. ipfw

9. Problems using "quotactl" C function under IRIX 5.x

10. Help with quotactl!!!

11. Compilation problem - quotactl() not found

12. quotactl() call not compiling

13. Quotactl under Solaris 2.3???