--- /dev/null
+new_perm = ( orig_inh & file_inh ) | ( file_perm & bound_set) ;
+new_inh = orig_inh ;
+new_eff = file_eff ? new_perm : 0 ;
+new_bound_set = bound_set ;
--- /dev/null
+PyObject * get_quota(int who, int id, const char *dev)
+{
+ struct dqblk dq;
+
+ if (!quotactl(QCMD(Q_GETQUOTA,who), dev, id, (caddr_t) &dq)) {
+ return Py_BuildValue("({s:K,s:(KK),s:K},{s:K,s:(KK),s:K})",
+ "used", dq.dqb_curspace,
+ "quota", dq.dqb_bsoftlimit, dq.dqb_bhardlimit,
+ "grace", dq.dqb_btime,
+ "used", dq.dqb_curinodes,
+ "quota", dq.dqb_isoftlimit, dq.dqb_ihardlimit,
+ "grace", dq.dqb_itime );
+ } else {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+}
--- /dev/null
+PyObject *set_block_quota(int who, int id, const char *dev, int soft, int hard)
+{
+ struct dqblk dq;
+
+ dq.dqb_bsoftlimit = soft;
+ dq.dqb_bhardlimit = hard;
+ dq.dqb_valid = QIF_BLIMITS;
+
+ if (!quotactl(QCMD(Q_SETQUOTA,who), dev, id, (caddr_t) &dq)) {
+ Py_RETURN_NONE;
+ } else {
+ PyErr_SetFromErrno(PyExc_OSError);
+ return NULL;
+ }
+}