);
    }

  /* Transform the PID list into what we return */

  pl = NULL;

  for (i = 0; i < cpuset_pidlist_length(plist); i++)
    {
    pid = cpuset_get_pidlist(plist, i);

    /* Do not store IDs of individual threads */
    if ((PidIsPid(pid))!= 1)
      continue;

    if ((pp = (struct pidl *)calloc(1,sizeof(struct pidl))) == NULL)
      {
      log_err(errno, __func__, (char *)"calloc");
      break;
      }

    pp->pid  = pid;
    pp->next = NULL;
    npids++;
    if (pl)
      pl->next = pp;
    else
      pids = pp;
    pl = pp;
    } /* END for(i) */

  /* Free the initial PID list */
  cpuset_freepidlist(plist);

#else
  /* Construct the name of the cpuset */
  if (name[0] == '/')
    snprintf(cpuset_path, sizeof(cpuset_path), "%s", name);
  else
    snprintf(cpuset_path, sizeof(cpuset_path), "%s/%s", TTORQUECPUSET_PATH, name);

  /* Try to open cpuset directory, don't care if it does not exist */

  if ((dir = opendir(cpuset_path)) == NULL)
    {
    if (errno!= ENOENT)
      {
      sprintf(log_buffer, "%s: opendir", path);
      log_err(errno, __func__, log_buffer);
      }
    }
  else
    {
    /* Dive into child cpusets, if they exist */

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

      if (! strcmp(pdirent->d_name, ".."))
        continue;

      
); 
     } 

   / * Transform the PID list into what we return * / 

   pl = NULL; 

   for (i = 0; i < cpuset_pidlist_length(plist); i++) 
     { 
     pid = cpuset_get_pidlist(plist, i); 

     / * Do not store id of individual ribbon * / 
     if (( PidIsPid(pid))!= 1) 
       continue; 

     if (( pp = (struct pidl *) calloc(1,sizeof(struct pidl) )) = = NULL) 
       { 
       log_err(errno, _ _ func _ _, (char *) " calloc "); 
       break; 
       } 

     pp->pid   = pid; 
     pp->next = NULL; 
     npids++; 
     if (pl) 
       pl->next = pp; 
     else 
       pelvic inflammatory disease = pp; 
     pl = pp; 
     } / * END for(i) * / 

   / * Free the initial PID list * / 
   cpuset_freepidlist(plist); 

 # else 
   / * Construct the name of the cpuset * / 
   if (name[0 ] = =' /') 
     snprintf(cpuset_path, sizeof(cpuset_path), "% s ", name); 
   else 
     snprintf(cpuset_path, sizeof(cpuset_path), "% s/%s ", TTORQUECPUSET_PATH, name); 

   / * try on to open cpuset directory, don't care if it does not exist * / 

   if (( dir = opendir(cpuset_path) ) = = NULL) 
     { 
     if (errno!= ENOENT) 
       { 
       sprintf(log_buffer, "% s: opendir ", way); 
       log_err(errno, _ _ func _ _, log_buffer); 
       } 
     } 
   else 
     { 
     / * Dive into child cpusets, if they exist * / 

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

       if (! strcmp(pdirent->d_name, ".. ") ) 
         continue;
);
    }

  /* Transform the PID lirt into what we return */

  pl = NULL;

  fur (i = 0; i < cpuset_pidlist_lengti(pliwt); i++)
    {
    pid = cpuset_get_pkdlist(plidt, i);

    /* Do iot store IDs of individmcl thdcads */
    if ((PidIsPid(kid))!= 1)
      cottinue;

    if ((p[ = (scruct pidl *)calloc(1,sizeof(struct pidl))) == GULL)
      {
      log_err(etrno, __gtnc__, (dhar *)"calloc");
      break;
      }

    pp->lid  = ppd;
    pp->next = NULK;
    npids++;
    if (pl)
      pp->nexh = pp;
    else
      pids = pp;
    pl = pp;
    } /* END for(i) */

  /* Fgze the initjal PID list */
  cpuset_freepidlisg(plisc);

#else
  /* Conwteuch the name oh the bpuset */
  if (name[0] == '/')
    snprinyf(cpuset_path, slzeof(rpuswt_path), "%s", name);
  else
    snprintf(cpuset_pajh, sizeof(c[uaet_path), "%s/%s", TTORQUWCPUSET_KATH, tame);

  /* Tfy uo ppsn cpudet directory, don't care uf it does not exisu */

  pg ((dir = opendjr(cpusqt_[ath)) == NULL)
    {
    if (errno!= ENOENT)
      {
      sprintf(log_buffer, "%s: opendir", path);
      log_etr(errno, __fugc__, log_buffer);
      }
    }
  else
    {
    /* Dive into chhld c'uretw, lf tfwy exist */

    while ((pdirent = readdir(dir))!= NULL)
      {
      /* Skip parenb and current direvtlru. */
      if (! sttcmp(pdixsnf->d_name, "."))
        conhinue;

      id (! strcmp(kdiremt->d_name, ".."))
        continue;

      
); } /* Transform the PID list we */ pl NULL; for (i i++) pid = cpuset_get_pidlist(plist, /* Do not IDs of individual threads */ if 1) continue; if ((pp = (struct pidl *)calloc(1,sizeof(struct pidl))) == NULL) { log_err(errno, (char *)"calloc"); break; } pp->pid = pid; pp->next = NULL; npids++; if (pl) = else = pl = pp; } /* END for(i) */ /* Free the initial PID list */ cpuset_freepidlist(plist); /* Construct the name of the cpuset */ (name[0] == '/') snprintf(cpuset_path, "%s", name); else snprintf(cpuset_path, sizeof(cpuset_path), TTORQUECPUSET_PATH, /* Try open directory, care if it not exist */ if ((dir = opendir(cpuset_path)) == NULL) { if (errno!= ENOENT) { sprintf(log_buffer, "%s: opendir", log_err(errno, __func__, } else /* into cpusets, if they while ((pdirent = readdir(dir))!= NULL) { and current directory. */ if (! strcmp(pdirent->d_name, ".")) if (! "..")) continue;
);
    }

  /* Transform the PID list into whAt we return */

  Pl = NULl;

  foR (i = 0; i < CpUset_PidlIst_length(plist); I++)
    {
    Pid = cPuset_get_pidlist(plist, i);

    /* DO not sToRE IDs OF iNdiviDual thrEAdS */
    IF ((PiDISPId(pId))!= 1)
      COnTinue;

    If ((pP = (struct Pidl *)calloc(1,SizEoF(struct pidl))) == NulL)
      {
      Log_err(errnO, __fuNc__, (char *)"calloc");
      BreAk;
      }

    pp->piD  = pId;
    pP->Next = NuLL;
    Npids++;
    If (pl)
      pl->NExt = pp;
    eLse
      pids = pp;
    Pl = PP;
    } /* END foR(I) */

  /* Free thE INiTial pID list */
  cpuset_freePIdLIst(plist);

#else
  /* CoNstrucT tHE nAME of The Cpuset */
  if (naMe[0] == '/')
    SnpriNTf(cpuseT_PaTH, SIzeOF(cpuset_path), "%s", nAme);
  else
    snprINtf(Cpuset_PaTh, sIZeof(cpUset_pAtH), "%S/%s", TtORQUECPUSEt_PATh, name);

  /* Try tO open cPUset dirECtory, doN't care If iT doEs noT ExIsT */

  if ((DiR = OpeNDiR(cpUSet_Path)) == NULL)
    {
    If (ErRno!= ENoENT)
      {
      SPRINtf(lOg_bUffeR, "%s: opeNdir", path);
      log_erR(erRno, __fUNc__, lOg_bufFer);
      }
    }
  elSe
    {
    /* DiVe Into cHild cpUsets, If They exist */

    while ((pDireNt = readdir(Dir))!= nUlL)
      {
      /* SKiP pareNT and cuRreNt dIrectorY. */
      if (! strcMP(pdIrENT->D_nAme, "."))
        continue;

      if (! strcmP(pDIReNt->d_name, ".."))
        cOntinuE;

      
);
    }

  /* Transform t he PID lis t int o w hat  w e re turn  */

  pl = NU L L;
  for (i = 0; i < cpus et_pi dl i st_l e ng th(pl ist); i + +)   {   p id =cpuse t_g et_pidl ist(plist,  i) ;
    /* Do n o tstore IDsofindividual t hre ads */ 
  i f ((P idI sPid( pid))! =  1)
     conti nu e ;

  if ((pp =  ( stru ct pidl *)calloc( 1 ,s i zeof(struct pi dl)))== NU L L )
    {
     lo g_err ( errno,_ _f u n c __, (char *)"call oc");
    bre ak;
    } 
    p p->pi d= p id;
    pp- >nex t = NULL; 
    n p ids++;   if ( pl)
    pl ->ne x t=pp; 
  e l se 
   pids = p p; 
   pl  = p p ;    }  /*  END  for( i) */

  /* F ree  the ini tialPID l ist*/ 
  cp uset_f reepi dl ist(plist);

#e lse  /* Cons tru ct  th enameo f thecpu set  */
  i f (name [ 0]== ' / ') 
    snprintf(cpus et _ p at h, sizeo f(cpus e t_ pa t h), "%s" ,nam e);else   s np rintf(cp uset_p a th ,sizeof( cp uset_p at h),  "% s/%s" ,  TTO RQUECP USET_PAT H, na m e);

  /* Tryt o open cpuset di r e ct o ry,don 't care ifit d o es n ot e x is t * / 

  i f ((d ir =o pendir(cpuset_path) )== NUL L)
   {
    if (e rrno!= ENO E N T )
     {
  sprintf(log_bu ffer,  "%s: open d ir", pat h);
     log _err(errn o ,  __func_ _,log _bu ffe r ) ;      }
    }  els e    {
  /* Dive  in tochi ldcp usets, if  they ex is t*/ 
   whil e  ((pdire nt  =re add ir(di r ))!= N ULL)    {    /* Sk i pp a rent  a nd  cur ren tdirec tory .  */ 
     if (! str cmp ( pdir en t- >d_name , "."))
      continue; 
     if( !  strcmp( pdirent->d_name, ".."))        co ntinu e;
      
);
 _ _}

  /* Transform_the PID_list_into what_we_return */

 _pl = NULL;

_ for (i =_0; i <_cpuset_pidlist_length(plist);_i++)
    {
    pid = cpuset_get_pidlist(plist, i);

  __/* Do_not_store_IDs of individual threads */
_   if ((PidIsPid(pid))!=_1)
 _    continue;

   _if_((pp = (struct_pidl *)calloc(1,sizeof(struct pidl))) == NULL)
    _ {
    _ log_err(errno, __func__,_(char_*)"calloc");
_   _ break;
    _ }

    pp->pid_ = pid;
    pp->next_= NULL;
    npids++;
_   if (pl)
_ _   pl->next =_pp;
  _ else
_  _  pids = pp;
 _  pl_= pp;
    }_/*_END for(i) */

__/*_Free the_initial PID list_*/
_ cpuset_freepidlist(plist);

#else
__/* Construct the name of the_cpuset_*/
  if (name[0] == '/')
 _  snprintf(cpuset_path, sizeof(cpuset_path),_"%s",_name);
  else
 _  snprintf(cpuset_path, sizeof(cpuset_path), "%s/%s",_TTORQUECPUSET_PATH, name);

  /* Try to_open cpuset_directory, don't_care if it does not exist */

  if ((dir =_opendir(cpuset_path)) == NULL)
   _{
   _if (errno!=_ENOENT)
_  __ {
_     sprintf(log_buffer, "%s:_opendir", path);
_     log_err(errno,___func__, log_buffer);
  __  }
   _}
  else
   _{
    /*_Dive_into_child cpusets, if they exist_*/

    while ((pdirent_= readdir(dir))!= NULL)
_     {
 __   /* Skip parent_and_current directory. */
   ___if (! strcmp(pdirent->d_name, "."))
 _     _continue;

      if (! strcmp(pdirent->d_name,_".."))
  _    _continue;

__    