10 int copy_user_quota_limits(const char *block_device, uid_t from, uid_t to)
14 if (quotactl(QCMD(Q_GETQUOTA, USRQUOTA), block_device, from, (caddr_t) & dq) == 0) {
15 if (quotactl(QCMD(Q_SETQLIM, USRQUOTA), block_device, to, (caddr_t) & dq) == 0) {
20 _("copy_user_quota_limits: Failed to set userquota for uid %ld : %s\n"),
27 _("copy_user_quota_limits: Failed to get userquota for uid %ld : %s\n"),
28 from, strerror(errno));
33 int copy_group_quota_limits(const char *block_device, gid_t from, gid_t to)
37 if (quotactl(QCMD(Q_GETQUOTA, GRPQUOTA), block_device, from, (caddr_t) & dq) == 0) {
38 if (quotactl(QCMD(Q_SETQLIM, GRPQUOTA), block_device, to, (caddr_t) & dq) == 0) {
43 _("copy_group_quota_limits: Failed to set groupquota for uid %ld : %s\n"),
50 _("copy_group_quota_limits: Failed to get groupquota for uid %ld : %s\n"),
51 from, strerror(errno));
56 main(int argc, char **argv)
59 copy_user_quota_limits("/dev/hda8", 152, 151);