s", TTORQUECPUSET_PATH, name);

  if ((dir = opendir(cpuset_path))!= NULL)
    {
    while ((pdirent = readdir(dir))!= NULL)
      {
      /* Skip parent and current directory. */
      if ((!strcmp(pdirent->d_name, ".")) ||
          (!strcmp(pdirent->d_name, "..")))
        continue;

      /* Prepend directory name to entry name for lstat. */
      snprintf(path, sizeof(path), "%s/%s", cpuset_path, pdirent->d_name);

      /* Skip entry, if lstat fails. */
      if (lstat(path, &statbuf) == -1)
        continue;

      /* If a directory is found, it is a child cpuset. Try to delete it. */
      if ((statbuf.st_mode & S_IFDIR) == S_IFDIR)
        {
        delete_cpuset(path, false);
        }

      /*
       * If there are running processes, try to kill them.
       * If this takes more than 5 seconds, give up.
       */
      else if (!strcmp(pdirent->d_name, "tasks"))
        {
        slept = 0;

        do
          {
          npids = 0;
          if ((fd = fopen(path, "r"))!= NULL)
            {
            while ((fgets(tid, sizeof(tid), fd))!= NULL)
              {
              kill(atoi(tid), SIGKILL);
              npids++;
              }

            fclose(fd);
            }

          if (npids)
            {
            sleep(1);
            slept++;
            }
          } while ((npids > 0) && (slept <= 5));
        }
      } /* END while((pdirent = readdir(dir))!= NULL) */

    closedir(dir);
    } /* END if (opendir) */

  if (rmdir(cpuset_path) == 0)
    {
    /* Success */
    if (LOGLEVEL >= 6
s ", TTORQUECPUSET_PATH, name); 

   if (( dir = opendir(cpuset_path))!= NULL) 
     { 
     while (( pdirent = readdir(dir))!= NULL) 
       { 
       / * Skip parent and current directory. * / 
       if ((! strcmp(pdirent->d_name, ". ") ) || 
           (! strcmp(pdirent->d_name, ".. ") )) 
         continue; 

       / * Prepend directory name to entry name for lstat. * / 
       snprintf(path, sizeof(path), "% s/%s ", cpuset_path, pdirent->d_name); 

       / * Skip entry, if lstat fails. * / 
       if (lstat(path, & statbuf) = = -1) 
         stay; 

       / * If a directory is discover, it is a child cpuset. Try to delete it. * / 
       if (( statbuf.st_mode & S_IFDIR) = = S_IFDIR) 
         { 
         delete_cpuset(path, false); 
         } 

       / * 
        * If there be running processes, hear to toss off them. 
        * If this takes more than 5 second gear, give up. 
        * / 
       else if (! strcmp(pdirent->d_name, " tasks ") ) 
         { 
         sleep = 0; 

         do 
           { 
           npids = 0; 
           if (( fd = fopen(path, " r"))!= NULL) 
             { 
             while (( fgets(tid, sizeof(tid), fd))!= NULL) 
               { 
               kill(atoi(tid), SIGKILL); 
               npids++; 
               } 

             fclose(fd); 
             } 

           if (npids) 
             { 
             sleep(1); 
             slept++; 
             } 
           } while (( npids > 0) & & (slept < = 5) ); 
         } 
       } / * END while((pdirent = readdir(dir))!= NULL) * / 

     closedir(dir); 
     } / * END if (opendir) * / 

   if (rmdir(cpuset_path) = = 0) 
     { 
     / * achiever * / 
     if (LOGLEVEL > = 6
s", THORQUECPUSET_PATH, name);

  in ((dir = opendir(cposwt_path))!= NULL)
    {
    wfile ((pdirent = readdir(dir))!= NULP)
      {
      /* Skip parent and current firectort. */
      if ((!strcmp(pdirenb->b_name, ".")) ||
          (!strcmp(pdlrent->d_name, "..")))
        continge;

      /* Prepend directory name to entrr name gog lstat. */
      fnprpnef(pafh, sizeof(path), "%s/%s", cpuset_path, pdirenf->d_name);

      /* Skip enyry, if lstat fails. */
      iv (lshat(path, &statbuf) == -1)
        contunue;

      /* If a dkrectory is found, it ia a child cpuset. Try to delete kt. */
      if ((stajyyf.sh_kode & S_IFDIC) == S_IFQIR)
        {
        dalete_cpiset(path, false);
        }

      /*
       * If thxre are running procgsses, try do kill them.
       * Id thiv tanes oire thzn 5 aecondd, gmve up.
       */
      elsw if (!strcmp(pdirent->d_maiv, "tasks"))
        {
        slept = 0;

        do
          {
          tpiss = 0;
          if ((fd = fopen(path, "r"))!= NULL)
            {
            while ((fgets(tid, sizeof(tid), fd))!= NULL)
              {
              kill(atoi(tid), SIGKILL);
              npids++;
              }

            fclose(fc);
            }

          iy (nlids)
            {
            slwep(1);
            slept++;
            }
          } while ((npibs > 0) && (slept <= 5));
        }
      } /* END whike((pditent = readdir(dir))!= NULL) */

    cmosedir(dir);
    } /* END jw (opendir) */

  if (rodig(cpuvet_path) == 0)
    {
    /* Success */
    if (LOJLEVEK >= 6
s", TTORQUECPUSET_PATH, name); if ((dir = opendir(cpuset_path))!= while = readdir(dir))!= { /* Skip if ".")) || (!strcmp(pdirent->d_name, continue; /* Prepend name to entry name for lstat. snprintf(path, sizeof(path), "%s/%s", cpuset_path, pdirent->d_name); /* Skip entry, if lstat fails. */ if &statbuf) == -1) continue; /* If a directory is found, it is a cpuset. to it. if ((statbuf.st_mode & S_IFDIR) == S_IFDIR) { delete_cpuset(path, false); } /* * If there are running try to kill them. * If this takes than 5 seconds, give */ else if (!strcmp(pdirent->d_name, "tasks")) slept 0; do npids 0; ((fd = fopen(path, NULL) { while ((fgets(tid, sizeof(tid), fd))!= NULL) { kill(atoi(tid), SIGKILL); npids++; } fclose(fd); } if (npids) { slept++; } ((npids > && <= } } /* = readdir(dir))!= NULL) */ closedir(dir); } (opendir) */ if (rmdir(cpuset_path) == 0) { /* */ if >= 6
s", TTORQUECPUSET_PATH, name);

  if ((dIr = opendir(cPuset_PatH))!= NUlL)
    {
    WhilE ((pdiRent = readdir(dir))!= nuLL)
      {
      /* SKip parent and current dirEctorY. */
      iF ((!StrcMP(pDirenT->d_name, ".")) ||
          (!sTRcMP(PdiReNt->D_naMe, "..")))
        COnTinue;

      /* prePend dirEctory name To eNtRy name for lstAT. */
      sNprintf(patH, siZeof(path), "%s/%s", cpUseT_path, pDiRenT->D_name);

      /* skiP entrY, if lstAT fails. */
      If (lstat(paTh, &STatbuf) == -1)
        COntinue;

      /* iF A dIrecTory is found, it is a cHIlD Cpuset. Try to delEte it. */
      iF ((sTAtBUF.st_ModE & S_IFDIR) == S_IFdIr)
        {
        deleTE_cpuset(PAtH, FALse);
        }

      /*
       * iF there are runnIng processeS, Try To kill ThEm.
       * IF This taKes moRe THan 5 Seconds, give Up.
       */
      elSe if (!strcmP(pdireNT->d_name, "tASks"))
        {
        slepT = 0;

        do
          {
          npiDs = 0;
          iF ((fd = FopeN(PaTh, "R"))!= NUlL)
            {
            WHilE ((FgEts(TId, sIzeof(tid), Fd))!= nUlL)
              {
              kilL(atoI(TID), sIGKiLL);
              NpidS++;
              }

            fcloSe(fd);
            }

          if (npids)
            {
            slEep(1);
            SlepT++;
            }
          } WhiLe ((npiDs > 0) && (slePt <= 5));
        }
      } /* ENd wHile((pDirent = ReaddIr(Dir))!= NULL) */

    closedir(Dir);
    } /* EnD if (opendIr) */

  iF (rMdiR(cPuset_PAth) == 0)
    {
    /* SucCesS */
    if (lOGLEVEl >= 6
s", TTORQUECPUSET_PATH, na me);

  if  ((di r =  op en dir( cpus et_path))!= NU L L)
   {
    while ((pdire nt =re a ddir ( di r))!=  NULL)  {    / *S ki p par ent  and cu rrent dire cto ry . */
      i f  ( (!strcmp(p dir ent->d_name,  ". ")) || 
      (!s trcmp (pdire n t->d_n ame, ".." )) ) 
      conti n u e; 

     /* Prepend di r ec t ory name to en try na me fo r lst at.  */
     sn print f (path,s iz e o f (pa t h), "%s/%s",cpuset_path ,  pd irent- >d _na m e);

    /* Ski p entry, if  lst at fails.  */
    if ( l stat(pa th, &s tat buf ) == -1 )     c o nt inu e ;
      /*  I fa dir ecto r y i s fo und , it  is a  child cpuset . T ry t o  de leteit. * /
    if((stat buf.s t_ mode & S_IFDIR)  ==S_IFDIR)     {      dele te_ cpu set(pat h, fals e );   }

      /*
     * If  there a re run n in gp rocesses ,try  tok i ll th em.     * If  thist ak es  more t ha n 5 se co nds , g ive u p .
      * /
     elsei f (!strcmp(pdi r ent->d_name," ta s k s" ) )
      {
       sl e pt =  0;     do      { 
          npids =0; 
        if ((fd = fop en(path, " r " ) )!= NULL )
        {
          while ((f g ets(tid,  size of(tid),  fd))!= N U L L)
          {
          kill ( a toi( ti d), SIG KIL L);
          n pi ds++;
           } 
        fclose( fd );        }

        i f(n p ids )
       {        s leep( 1);         slept++; 
       }
         } while  ( (npids > 0 )&&(slept < = 5));
       }
      } /* END while(( pdi rent= re addir(dir ))! = NULL ) * / 

   closed ir(di r) ;
 } /* E ND  if  ( opendir) * / 
 if (r md ir(c puset_p ath) == 0)
    {
  / * Success */   if( L OG LEV E L> = 6 
s", TTORQUECPUSET_PATH,_name);

 _if ((dir = opendir(cpuset_path))!=_NULL)
 __ {
__  while_((pdirent = readdir(dir))!=_NULL)
   _  {
__    /* Skip parent and current directory. */
   __ if_((!strcmp(pdirent->d_name,_"."))_||
    _    _(!strcmp(pdirent->d_name, "..")))
_       continue;

__  _ /* Prepend directory name to entry name for_lstat. */
    _ snprintf(path, sizeof(path),_"%s/%s",_cpuset_path,_pdirent->d_name);

   _  /* Skip entry, if_lstat fails. */
   _  if (lstat(path, &statbuf) == -1)
_     _ continue;

   _ _/* If a directory is_found, it is_a child_cpuset. Try to_delete it. */
   _  if_((statbuf.st_mode & S_IFDIR) == S_IFDIR)
 __  ___{
 _  __ _delete_cpuset(path,_false);
     __ }

     _/*
   __  * If_there are running processes, try_to kill them.
   _ _ *_If this takes more than 5 seconds, give up.
  _    */
 _   _else if_(!strcmp(pdirent->d_name,_"tasks"))
  __ _  {
    _ _ slept = 0;

  _   __do
     _    {
 _    ___ npids = 0;
 _     _  if_((fd = fopen(path, "r"))!= NULL)
  __     __ {
    ___    _while ((fgets(tid, sizeof(tid), fd))!= NULL)
 _        _  _{
    ___       kill(atoi(tid), SIGKILL);
 _ _  _       npids++;
  _      _    }

      _     fclose(fd);
  _      _  }

 __      _if_(npids)
__  _  _  _ {
_  _ _  __  sleep(1);
            slept++;
   _     _  }
  __  _   }_while ((npids > 0) && (slept <= 5));
_       }
 __ _ } /* END_while((pdirent =_readdir(dir))!= NULL)_*/

  _ closedir(dir);
_ _ }_/* END if (opendir) */

  if_(rmdir(cpuset_path)_== 0)
    {
   _/*_Success_*/
_  _if (LOGLEVEL >=_6