1*bbf21555SRichard Lowe.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved 2*bbf21555SRichard Lowe.\" Copyright (c) 2017, Joyent, Inc. 3*bbf21555SRichard Lowe.\" The contents of this file are subject to the terms of the 4*bbf21555SRichard Lowe.\" Common Development and Distribution License (the "License"). 5*bbf21555SRichard Lowe.\" You may not use this file except in compliance with the License. 6*bbf21555SRichard Lowe.\" 7*bbf21555SRichard Lowe.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 8*bbf21555SRichard Lowe.\" or http://www.opensolaris.org/os/licensing. 9*bbf21555SRichard Lowe.\" See the License for the specific language governing permissions 10*bbf21555SRichard Lowe.\" and limitations under the License. 11*bbf21555SRichard Lowe.\" 12*bbf21555SRichard Lowe.\" When distributing Covered Code, include this CDDL HEADER in each 13*bbf21555SRichard Lowe.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 14*bbf21555SRichard Lowe.\" If applicable, add the following below this CDDL HEADER, with the 15*bbf21555SRichard Lowe.\" fields enclosed by brackets "[]" replaced with your own identifying 16*bbf21555SRichard Lowe.\" information: Portions Copyright [yyyy] [name of copyright owner] 17*bbf21555SRichard Lowe.Dd October 28, 2017 18*bbf21555SRichard Lowe.Dt QUOTACTL 4I 19*bbf21555SRichard Lowe.Os 20*bbf21555SRichard Lowe.Sh NAME 21*bbf21555SRichard Lowe.Nm quotactl 22*bbf21555SRichard Lowe.Nd manipulate disk quotas 23*bbf21555SRichard Lowe.Sh SYNOPSIS 24*bbf21555SRichard Lowe.In sys/fs/ufs_quota.h 25*bbf21555SRichard Lowe.Fn "int ioctl" "int fd" "Q_QUOTACTL" "struct quotctl *qp" 26*bbf21555SRichard Lowe.Sh DESCRIPTION 27*bbf21555SRichard LoweThis 28*bbf21555SRichard Lowe.Fn ioctl 29*bbf21555SRichard Lowecall manipulates disk quotas. 30*bbf21555SRichard Lowe.Fa fd 31*bbf21555SRichard Loweis the file descriptor returned by the 32*bbf21555SRichard Lowe.Xr open 2 33*bbf21555SRichard Lowesystem call after opening the 34*bbf21555SRichard Lowe.Pa quotas 35*bbf21555SRichard Lowefile (located in the root directory of the filesystem running quotas). 36*bbf21555SRichard Lowe.Dv Q_QUOTACTL 37*bbf21555SRichard Loweis defined in 38*bbf21555SRichard Lowe.Pa /usr/include/sys/fs/ufs_quota.h . 39*bbf21555SRichard Lowe.Fa qp 40*bbf21555SRichard Loweis the address of the 41*bbf21555SRichard Lowe.Vt quotctl 42*bbf21555SRichard Lowestructure which is defined as 43*bbf21555SRichard Lowe.Bd -literal -offset 2n 44*bbf21555SRichard Lowestruct quotctl { 45*bbf21555SRichard Lowe int op; 46*bbf21555SRichard Lowe uid_t uid; 47*bbf21555SRichard Lowe caddr_t addr; 48*bbf21555SRichard Lowe}; 49*bbf21555SRichard Lowe.Ed 50*bbf21555SRichard Lowe.Pp 51*bbf21555SRichard Lowe.Fa op 52*bbf21555SRichard Loweindicates an operation to be applied to the user 53*bbf21555SRichard Lowe.Sy ID 54*bbf21555SRichard Lowe.Fa uid . 55*bbf21555SRichard Lowe.Po 56*bbf21555SRichard LoweSee below. 57*bbf21555SRichard Lowe.Pc 58*bbf21555SRichard Lowe.Fa addr 59*bbf21555SRichard Loweis the address of an optional, command specific, data 60*bbf21555SRichard Lowestructure which is copied in or out of the system. 61*bbf21555SRichard LoweThe interpretation of 62*bbf21555SRichard Lowe.Fa addr 63*bbf21555SRichard Loweis given with each value of 64*bbf21555SRichard Lowe.Fa op 65*bbf21555SRichard Lowebelow. 66*bbf21555SRichard Lowe.Bl -tag -width Q_GETQUOTA 67*bbf21555SRichard Lowe.It Sy Q_QUOTAON 68*bbf21555SRichard LoweTurn on quotas for a file system. 69*bbf21555SRichard Lowe.Fa addr 70*bbf21555SRichard Lowepoints to the full pathname of the 71*bbf21555SRichard Lowe.Pa quotas 72*bbf21555SRichard Lowefile. 73*bbf21555SRichard Lowe.Fa uid 74*bbf21555SRichard Loweis ignored. 75*bbf21555SRichard LoweIt is recommended that 76*bbf21555SRichard Lowe.Fa uid 77*bbf21555SRichard Lowehave the value of 78*bbf21555SRichard Lowe.Sy 0 . 79*bbf21555SRichard LoweThis call is restricted to the super-user. 80*bbf21555SRichard Lowe.It Dv Q_QUOTAOFF 81*bbf21555SRichard LoweTurn off quotas for a file system. 82*bbf21555SRichard Lowe.Fa addr 83*bbf21555SRichard Loweand 84*bbf21555SRichard Lowe.Fa uid 85*bbf21555SRichard Loweare ignored. 86*bbf21555SRichard LoweIt is 87*bbf21555SRichard Lowerecommended that 88*bbf21555SRichard Lowe.Fa addr 89*bbf21555SRichard Lowehave the value of 90*bbf21555SRichard Lowe.Sy NULL 91*bbf21555SRichard Loweand 92*bbf21555SRichard Lowe.Fa uid 93*bbf21555SRichard Lowehave the value of 94*bbf21555SRichard Lowe.Sy 0 . 95*bbf21555SRichard LoweThis call is restricted to the super-user. 96*bbf21555SRichard Lowe.It Dv Q_GETQUOTA 97*bbf21555SRichard LoweGet disk quota limits and current usage for user 98*bbf21555SRichard Lowe.Fa uid . 99*bbf21555SRichard Lowe.Fa addr 100*bbf21555SRichard Loweis a pointer to a 101*bbf21555SRichard Lowe.Vt dqblk 102*bbf21555SRichard Lowestructure 103*bbf21555SRichard Lowe.Po 104*bbf21555SRichard Lowedefined in 105*bbf21555SRichard Lowe.In sys/fs/ufs_quota.h 106*bbf21555SRichard Lowe.Pc . 107*bbf21555SRichard LoweOnly the super-user may get the quotas of a user other than himself. 108*bbf21555SRichard Lowe.It Dv Q_SETQUOTA 109*bbf21555SRichard LoweSet disk quota limits and current usage for user 110*bbf21555SRichard Lowe.Fa uid . 111*bbf21555SRichard Lowe.Fa addr 112*bbf21555SRichard Loweis a pointer to a 113*bbf21555SRichard Lowe.Vt dqblk 114*bbf21555SRichard Lowestructure 115*bbf21555SRichard Lowe.Po 116*bbf21555SRichard Lowedefined in 117*bbf21555SRichard Lowe.In sys/fs/ufs_quota.h 118*bbf21555SRichard Lowe.Pc . 119*bbf21555SRichard LoweThis call is restricted to the super-user. 120*bbf21555SRichard Lowe.It Dv Q_SETQLIM 121*bbf21555SRichard LoweSet disk quota limits for user 122*bbf21555SRichard Lowe.Fa uid . 123*bbf21555SRichard Lowe.Fa addr 124*bbf21555SRichard Loweis a pointer to a 125*bbf21555SRichard Lowe.Vt dqblk 126*bbf21555SRichard Lowestructure 127*bbf21555SRichard Lowe.Po 128*bbf21555SRichard Lowedefined in 129*bbf21555SRichard Lowe.In sys/fs/ufs_quota.h 130*bbf21555SRichard Lowe.Pc . 131*bbf21555SRichard LoweThis call is restricted to the super-user. 132*bbf21555SRichard Lowe.It Dv Q_SYNC 133*bbf21555SRichard LoweUpdate the on-disk copy of quota usages for this file system. 134*bbf21555SRichard Lowe.Fa addr 135*bbf21555SRichard Loweand 136*bbf21555SRichard Lowe.Fa uid 137*bbf21555SRichard Loweare ignored. 138*bbf21555SRichard Lowe.It Dv Q_ALLSYNC 139*bbf21555SRichard LoweUpdate the on-disk copy of quota usages for all file systems with active 140*bbf21555SRichard Lowequotas. 141*bbf21555SRichard Lowe.Fa addr 142*bbf21555SRichard Loweand 143*bbf21555SRichard Lowe.Fa uid 144*bbf21555SRichard Loweare ignored. 145*bbf21555SRichard Lowe.El 146*bbf21555SRichard Lowe.Sh RETURN VALUES 147*bbf21555SRichard LoweThis 148*bbf21555SRichard LoweFn ioctl 149*bbf21555SRichard Lowereturns: 150*bbf21555SRichard Lowe.Bl -tag -width xx 151*bbf21555SRichard Lowe.It Sy 0 152*bbf21555SRichard Loweon success. 153*bbf21555SRichard Lowe.It Sy \(mi1 154*bbf21555SRichard Loweon failure and sets 155*bbf21555SRichard Lowe.Va errno 156*bbf21555SRichard Loweto indicate the error. 157*bbf21555SRichard Lowe.El 158*bbf21555SRichard Lowe.Sh FILES 159*bbf21555SRichard Lowe.Bl -tag -width x 160*bbf21555SRichard Lowe.It Pa /usr/include/sys/fs/ufs_quota.h 161*bbf21555SRichard Lowequota-related structure/function definitions and defines 162*bbf21555SRichard Lowe.El 163*bbf21555SRichard Lowe.Sh ERRORS 164*bbf21555SRichard Lowe.Bl -tag -width EFAULT 165*bbf21555SRichard Lowe.It Er EFAULT 166*bbf21555SRichard Lowe.Fa addr 167*bbf21555SRichard Loweis invalid. 168*bbf21555SRichard Lowe.It Er EINVAL 169*bbf21555SRichard LoweThe kernel has not been compiled with the 170*bbf21555SRichard Lowe.Sy QUOTA 171*bbf21555SRichard Loweoption. 172*bbf21555SRichard Lowe.Fa op 173*bbf21555SRichard Loweis invalid. 174*bbf21555SRichard Lowe.It Er ENOENT 175*bbf21555SRichard LoweThe 176*bbf21555SRichard Lowe.Pa quotas 177*bbf21555SRichard Lowefile specified by 178*bbf21555SRichard Lowe.Fa addr 179*bbf21555SRichard Lowedoes not exist. 180*bbf21555SRichard Lowe.It Er EPERM 181*bbf21555SRichard LoweThe call is privileged and the calling process did not assert 182*bbf21555SRichard Lowe.Brq Sy PRIV_SYS_MOUNT 183*bbf21555SRichard Lowein the effective set. 184*bbf21555SRichard Lowe.It Er ESRCH 185*bbf21555SRichard LoweNo disk quota is found for the indicated user. 186*bbf21555SRichard LoweQuotas have not been turned on for this file system. 187*bbf21555SRichard Lowe.It Er EUSERS 188*bbf21555SRichard LoweThe quota table is full. 189*bbf21555SRichard Lowe.El 190*bbf21555SRichard Lowe.Pp 191*bbf21555SRichard LoweIf 192*bbf21555SRichard Lowe.Fa op 193*bbf21555SRichard Loweis 194*bbf21555SRichard Lowe.Dv Q_QUOTAON , 195*bbf21555SRichard Lowe.Fn ioctl 196*bbf21555SRichard Lowemay set 197*bbf21555SRichard Lowe.Va errno 198*bbf21555SRichard Loweto: 199*bbf21555SRichard Lowe.Bl -tag -width EACCES 200*bbf21555SRichard Lowe.It Er EACCES 201*bbf21555SRichard LoweThe quota file pointed to by 202*bbf21555SRichard Lowe.Fa addr 203*bbf21555SRichard Loweexists but is not a regular file. 204*bbf21555SRichard LoweThe quota file pointed to by 205*bbf21555SRichard Lowe.Fa addr 206*bbf21555SRichard Loweexists but is not on the file system pointed to by 207*bbf21555SRichard Lowe.Fa special . 208*bbf21555SRichard Lowe.It Er EIO 209*bbf21555SRichard LoweInternal I/O error while attempting to read the 210*bbf21555SRichard Lowe.Pa quotas 211*bbf21555SRichard Lowefile pointed to by 212*bbf21555SRichard Lowe.Fa addr . 213*bbf21555SRichard Lowe.El 214*bbf21555SRichard Lowe.Sh SEE ALSO 215*bbf21555SRichard Lowe.Xr getrlimit 2 , 216*bbf21555SRichard Lowe.Xr mount 2 , 217*bbf21555SRichard Lowe.Xr quota 8 , 218*bbf21555SRichard Lowe.Xr quotacheck 8 , 219*bbf21555SRichard Lowe.Xr quotaon 8 220*bbf21555SRichard Lowe.Sh BUGS 221*bbf21555SRichard LoweThere should be some way to integrate this call with the resource limit 222*bbf21555SRichard Loweinterface provided by 223*bbf21555SRichard Lowe.Xr setrlimit 2 224*bbf21555SRichard Loweand 225*bbf21555SRichard Lowe.Xr getrlimit 2 . 226*bbf21555SRichard Lowe.Pp 227*bbf21555SRichard LoweThis call is incompatible with Melbourne quotas. 228