Quota

 view release on metacpan or  search on metacpan

Quota.xs  view on Meta::CPAN

 */

MODULE = Quota  PACKAGE = Quota
PROTOTYPES: DISABLE

void
query(dev,uid=getuid(),kind=0)
	char *	dev
	int	uid
	int     kind
	PPCODE:
	{
	  char *p = NULL;
	  int err;
#ifndef NO_RPC
          quota_rpc_strerror = NULL;
#endif
#ifdef SGI_XFS
	  if(!strncmp(dev, "(XFS)", 5)) {
	    fs_disk_quota_t xfs_dqblk;
#ifndef linux

Quota.xs  view on Meta::CPAN

	OUTPUT:
	RETVAL


void
rpcquery(host,path,uid=getuid(),kind=0)
	char *	host
	char *	path
	int	uid
	int     kind
	PPCODE:
	{
#ifndef NO_RPC
          struct quota_xs_nfs_rslt rslt;
          quota_rpc_strerror = NULL;
          if (getnfsquota(host, path, uid, kind, &rslt) == 0) {
	    EXTEND(SP, 8);
            PUSHs(sv_2mortal(newSVnv(Q_DIV(rslt.bcur))));
            PUSHs(sv_2mortal(newSVnv(Q_DIV(rslt.bsoft))));
            PUSHs(sv_2mortal(newSVnv(Q_DIV(rslt.bhard))));
            PUSHs(sv_2mortal(newSViv(rslt.btime)));

Quota.xs  view on Meta::CPAN

#else
	  errno = ENOTSUP;
#endif
	}

void
rpcpeer(port=0,use_tcp=FALSE,timeout=RPC_DEFAULT_TIMEOUT)
	unsigned port
	unsigned use_tcp
	unsigned timeout
	PPCODE:
	{
#ifndef NO_RPC
          quota_rpc_strerror = NULL;
	  quota_rpc_cfg.port = port;
	  quota_rpc_cfg.use_tcp = use_tcp;
	  quota_rpc_cfg.timeout = timeout;
#endif
	}

int

Quota.xs  view on Meta::CPAN

	    errno = ENOENT;
	    RETVAL = -1;
	  }
#endif
	}
	OUTPUT:
	RETVAL

void
getmntent()
	PPCODE:
	{
#ifndef NO_RPC
          quota_rpc_strerror = NULL;
#endif
#ifndef AIX
#ifndef NO_MNTENT
#ifndef NO_OPEN_MNTTAB
	  struct mntent *mntp;
	  if(mtab != NULL) {
	    mntp = getmntent(mtab);

Quota.xs  view on Meta::CPAN

	    PUSHs(sv_2mortal(newSVpv(cp, strlen(cp))));

	    cp = vmt2dataptr(vmp, VMT_ARGS);
	    PUSHs(sv_2mortal(newSVpv(cp, strlen(cp))));
	  }
#endif
	}

void
endmntent()
	PPCODE:
	{
#ifndef NO_RPC
          quota_rpc_strerror = NULL;
#endif
	  if(mtab != NULL) {
#ifndef AIX
#ifndef NO_MNTENT
#ifndef NO_OPEN_MNTTAB
	    endmntent(mtab);   /* returns always 1 in SunOS */
#else

contrib/aix_jfs2_class/jfs2class.xs  view on Meta::CPAN

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Perl Artistic License or GNU General Public License for more details.
 */

MODULE = Quota  PACKAGE = Quota::JFS2CLASS

void
jfs2_getlimit(dev,class)
	char *	dev
	int	class
	PPCODE:
#if defined(HAVE_JFS2)
        if (strncmp(dev, "(JFS2)", 6) == 0) {
          j2qlimit_t j2q;
          int retval;

          memset(&j2q, 0, sizeof(j2q));
          retval = quotactl (dev + 6, Q_J2GETLIMIT, class, (caddr_t)&j2q);
          if (retval == 0) {
            EXTEND(sp, 8);
            PUSHs(sv_2mortal(newSViv(j2q.ql_bsoft)));

contrib/aix_jfs2_class/jfs2class.xs  view on Meta::CPAN


void
jfs2_newlimit(dev,bs,bh,bt,fs,fh,ft)
	char *	dev
	int	bs
	int	bh
	int	bt
	int	fs
	int	fh
	int	ft
	PPCODE:
#if defined(HAVE_JFS2)
        if (strncmp(dev, "(JFS2)", 6) == 0) {
          j2qlimit_t j2q;
          uid_t class;
          int retval;

          memset(&j2q, 0, sizeof(j2q));
          j2q.ql_bsoft = bs;
          j2q.ql_bhard = bh;
          j2q.ql_btime = bt;

contrib/aix_jfs2_class/jfs2class.xs  view on Meta::CPAN

          RETVAL = -1;
          errno = ENOENT;
        }
        OUTPUT:
        RETVAL

void
jfs2_getnextq(dev,class)
	char *	dev
	int	class
	PPCODE:
#if defined(HAVE_JFS2)
        if (strncmp(dev, "(JFS2)", 6) == 0) {
          uid_t id_buf = 0;
          int retval;

          //retval = quotactl (dev + 6, QCMD(Q_J2GETNEXTQ,USRQUOTA), class, (caddr_t) &id_buf);
          retval = quotactl (dev + 6, Q_J2GETNEXTQ, class, (caddr_t) &id_buf);
          printf("Q_J2GETNEXTQ(%s,%d)=%d ID=%d\n",dev+6,class,retval,id_buf);
          if (retval == 0) {
            EXTEND(sp, 1);



( run in 0.333 second using v1.01-cache-2.11-cpan-5511b514fd6 )