亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? machine.c

?? Ho Chi Minh City University of Technology Computer Science Department Distributed Computing E
?? C
?? 第 1 頁 / 共 3 頁
字號:
  2,				/* zombie		*/  4,				/* stop			*/  5,				/* start		*/  7,				/* run on a processor   */  1				/* being swapped (WAIT)	*/};/* compare_cpu - the comparison function for sorting by cpu percentage */intcompare_cpu (	       struct prpsinfo **pp1,	       struct prpsinfo **pp2)  {    register struct prpsinfo *p1;    register struct prpsinfo *p2;    register long result;    double dresult;    /* remove one level of indirection */    p1 = *pp1;    p2 = *pp2;    ORDERKEY_PCTCPU    ORDERKEY_CPTICKS    ORDERKEY_STATE    ORDERKEY_PRIO    ORDERKEY_RSSIZE    ORDERKEY_MEM    ;    return (result);  }/* compare_size - the comparison function for sorting by total memory usage */intcompare_size (	       struct prpsinfo **pp1,	       struct prpsinfo **pp2)  {    register struct prpsinfo *p1;    register struct prpsinfo *p2;    register long result;    double dresult;    /* remove one level of indirection */    p1 = *pp1;    p2 = *pp2;    ORDERKEY_MEM    ORDERKEY_RSSIZE    ORDERKEY_PCTCPU    ORDERKEY_CPTICKS    ORDERKEY_STATE    ORDERKEY_PRIO    ;    return (result);  }/* compare_res - the comparison function for sorting by resident set size */intcompare_res (	       struct prpsinfo **pp1,	       struct prpsinfo **pp2)  {    register struct prpsinfo *p1;    register struct prpsinfo *p2;    register long result;    double dresult;    /* remove one level of indirection */    p1 = *pp1;    p2 = *pp2;    ORDERKEY_RSSIZE    ORDERKEY_MEM    ORDERKEY_PCTCPU    ORDERKEY_CPTICKS    ORDERKEY_STATE    ORDERKEY_PRIO    ;    return (result);  }/* compare_time - the comparison function for sorting by total cpu time */intcompare_time (	       struct prpsinfo **pp1,	       struct prpsinfo **pp2)  {    register struct prpsinfo *p1;    register struct prpsinfo *p2;    register long result;    double dresult;    /* remove one level of indirection */    p1 = *pp1;    p2 = *pp2;    ORDERKEY_CPTICKS    ORDERKEY_PCTCPU    ORDERKEY_STATE    ORDERKEY_PRIO    ORDERKEY_MEM    ORDERKEY_RSSIZE    ;    return (result);  }/*get process table V.4 only has a linked list of processes so we want to follow that linked list, get all the process structures, and put them in our own table*/voidgetptable (struct prpsinfo *baseptr){  struct prpsinfo *currproc;	/* pointer to current proc structure	*/#ifndef USE_NEW_PROC  struct prstatus prstatus;     /* for additional information */#endif  int numprocs = 0;  int i;  struct dirent *direntp;  struct oldproc *op;  static struct timeval lasttime =  {0, 0};  struct timeval thistime;  double timediff;  double alpha, beta;  struct oldproc *endbase;  gettimeofday (&thistime, NULL);  /*   * To avoid divides, we keep times in nanoseconds.  This is   * scaled by 1e7 rather than 1e9 so that when we divide we   * get percent.   */  if (lasttime.tv_sec)    timediff = ((double) thistime.tv_sec * 1.0e7 +		((double) thistime.tv_usec * 10.0)) -      ((double) lasttime.tv_sec * 1.0e7 +       ((double) lasttime.tv_usec * 10.0));  else    timediff = 1.0e7;  /*     * constants for exponential average.  avg = alpha * new + beta * avg     * The goal is 50% decay in 30 sec.  However if the sample period     * is greater than 30 sec, there's not a lot we can do.     */  if (timediff < 30.0e7)    {      alpha = 0.5 * (timediff / 30.0e7);      beta = 1.0 - alpha;    }  else    {      alpha = 0.5;      beta = 0.5;    }  endbase = oldbase + oldprocs;  currproc = baseptr;  /* before reading /proc files, turn on root privs */  /* (we don't care if this fails since it will be caught later) */#ifndef USE_NEW_PROC  seteuid(0);#endif  for (rewinddir (procdir); (direntp = readdir (procdir));)    {      int fd;#ifdef USE_NEW_PROC      char buf[30];      sprintf(buf,"%s/psinfo", direntp->d_name);      if ((fd = open (buf, O_RDONLY)) < 0)	continue;      if (read(fd, currproc, sizeof(psinfo_t)) != sizeof(psinfo_t))	{	  (void) close (fd);	  continue;	}       #else      if ((fd = open (direntp->d_name, O_RDONLY)) < 0)	continue;      if (ioctl (fd, PIOCPSINFO, currproc) < 0)	{	  (void) close (fd);	  continue;	}      if (ioctl (fd, PIOCSTATUS, &prstatus) < 0)      {	  /* not a show stopper -- just fill in the needed values */	  currproc->pr_fill = 0;	  currproc->pr_onpro = 0;       } else {	  /* copy over the values we need from prstatus */	  currproc->pr_fill = (short)prstatus.pr_nlwp;	  currproc->pr_onpro = prstatus.pr_processor;       }#endif      /*       * SVr4 doesn't keep track of CPU% in the kernel, so we have       * to do our own.  See if we've heard of this process before.       * If so, compute % based on CPU since last time.       * NOTE:  Solaris 2.4 and higher do maintain CPU% in prpsinfo.       */      op = oldbase + HASH (currproc->pr_pid);      while (1)	{	  if (op->oldpid == -1)	/* not there */	    break;	  if (op->oldpid == currproc->pr_pid)	    {			/* found old data */#ifndef SOLARIS24	      percent_cpu (currproc) =		((currproc->pr_time.tv_sec * 1.0e9 +		  currproc->pr_time.tv_nsec)		 - op->oldtime) / timediff;#endif	      weighted_cpu (currproc) =		op->oldpct * beta + percent_cpu (currproc) * alpha;	      break;	    }	  op++;			/* try next entry in hash table */	  if (op == endbase)	/* table wrapped around */	    op = oldbase;	}      /* Otherwise, it's new, so use all of its CPU time */      if (op->oldpid == -1)	{#ifdef SOLARIS24	  weighted_cpu (currproc) =	    percent_cpu (currproc);#else	  if (lasttime.tv_sec)	    {	      percent_cpu (currproc) =		(currproc->pr_time.tv_sec * 1.0e9 +		 currproc->pr_time.tv_nsec) / timediff;	      weighted_cpu (currproc) =		percent_cpu (currproc);	    }	  else	    {			/* first screen -- no difference is possible */	      percent_cpu (currproc) = 0.0;	      weighted_cpu (currproc) = 0.0;	    }#endif	}      numprocs++;      currproc = (struct prpsinfo *) ((char *) currproc + PRPSINFOSIZE);      (void) close (fd);#ifdef NO_NPROC      /* Atypical place for growth */      if (numprocs >= maxprocs) {	    reallocproc(2 * numprocs);	    currproc = (struct prpsinfo *)		    ((char *)baseptr + PRPSINFOSIZE * numprocs);      }#endif    }#ifndef USE_NEW_PROC  /* turn off root privs */  seteuid(getuid());#endif  if (nproc != numprocs)    nproc = numprocs;  /*   * Save current CPU time for next time around   * For the moment recreate the hash table each time, as the code   * is easier that way.   */  oldprocs = 2 * nproc;  endbase = oldbase + oldprocs;  for (op = oldbase; op < endbase; op++)    op->oldpid = -1;  for (i = 0, currproc = baseptr;       i < nproc;     i++, currproc = (struct prpsinfo *) ((char *) currproc + PRPSINFOSIZE))    {      /* find an empty spot */      op = oldbase + HASH (currproc->pr_pid);      while (1)	{	  if (op->oldpid == -1)	    break;	  op++;	  if (op == endbase)	    op = oldbase;	}      op->oldpid = currproc->pr_pid;      op->oldtime = (currproc->pr_time.tv_sec * 1.0e9 +		     currproc->pr_time.tv_nsec);      op->oldpct = weighted_cpu (currproc);    }  lasttime = thistime;}/* * proc_owner(pid) - returns the uid that owns process "pid", or -1 if *              the process does not exist. *              It is EXTREMLY IMPORTANT that this function work correctly. *              If top runs setuid root (as in SVR4), then this function *              is the only thing that stands in the way of a serious *              security problem.  It validates requests for the "kill" *              and "renice" commands. */uid_tproc_owner (pid_t pid){  register struct prpsinfo *p;  int i;  for (i = 0, p = pbase; i < nproc;       i++, p = (struct prpsinfo *) ((char *) p + PRPSINFOSIZE)) {    if (p->pr_pid == pid)      return (p->pr_uid);  }  return (-1);}#if OSREV < 55intsetpriority (int dummy, int who, int niceval){  int scale;  int prio;  pcinfo_t pcinfo;  pcparms_t pcparms;  tsparms_t *tsparms;  strcpy (pcinfo.pc_clname, "TS");  if (priocntl (0, 0, PC_GETCID, (caddr_t) & pcinfo) == -1)    return (-1);  prio = niceval;  if (prio > PRIO_MAX)    prio = PRIO_MAX;  else if (prio < PRIO_MIN)    prio = PRIO_MIN;  tsparms = (tsparms_t *) pcparms.pc_clparms;  scale = ((tsinfo_t *) pcinfo.pc_clinfo)->ts_maxupri;  tsparms->ts_uprilim = tsparms->ts_upri = -(scale * prio) / 20;  pcparms.pc_cid = pcinfo.pc_cid;  if (priocntl (P_PID, who, PC_SETPARMS, (caddr_t) & pcparms) == -1)    return (-1);  return (0);}#endifget_swapinfo(int *total, int *fr){    register int cnt, i;    register int t, f;    struct swaptable *swt;    struct swapent *ste;    static char path[256];    /* get total number of swap entries */    cnt = swapctl(SC_GETNSWP, 0);    /* allocate enough space to hold count + n swapents */    swt = (struct swaptable *)malloc(sizeof(int) +				     cnt * sizeof(struct swapent));    if (swt == NULL)    {	*total = 0;	*fr = 0;	return;    }    swt->swt_n = cnt;    /* fill in ste_path pointers: we don't care about the paths, so we point       them all to the same buffer */    ste = &(swt->swt_ent[0]);    i = cnt;    while (--i >= 0)    {	ste++->ste_path = path;    }    /* grab all swap info */    swapctl(SC_LIST, swt);    /* walk thru the structs and sum up the fields */    t = f = 0;    ste = &(swt->swt_ent[0]);    i = cnt;    while (--i >= 0)    {	/* dont count slots being deleted */	if (!(ste->ste_flags & ST_INDEL) &&	    !(ste->ste_flags & ST_DOINGDEL))	{	    t += ste->ste_pages;	    f += ste->ste_free;	}	ste++;    }    /* fill in the results */    *total = t;    *fr = f;    free(swt);}/* * When we reach a proc limit, we need to realloc the stuff. */static void reallocproc(int n){    int bytes;    struct oldproc *op, *endbase;    if (n < maxprocs)	return;    maxprocs = n;    /* allocate space for proc structure array and array of pointers */    bytes = maxprocs * PRPSINFOSIZE;    pbase = (struct prpsinfo *) realloc(pbase, bytes);    pref = (struct prpsinfo **) realloc(pref,			maxprocs * sizeof(struct prpsinfo *));    oldbase = (struct oldproc *) realloc(oldbase,			2 * maxprocs * sizeof(struct oldproc));    /* Just in case ... */    if (pbase == (struct prpsinfo *) NULL || pref == (struct prpsinfo **) NULL	|| oldbase == (struct oldproc *) NULL)      {	fprintf (stderr, "%s: can't allocate sufficient memory\n", myname);	quit(1);      }    /*     * We're growing from 0 to some number, only then we need to     * init the oldproc stuff     */    if (!oldprocs) {	oldprocs = 2 * maxprocs;	endbase = oldbase + oldprocs;	for (op = oldbase; op < endbase; op++)	  op->oldpid = -1;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产电影一区二区三区| 亚洲123区在线观看| 日韩欧美电影在线| 国产精品久久夜| 蜜臀va亚洲va欧美va天堂| 国产99久久久国产精品潘金 | 日韩黄色一级片| 成人午夜视频免费看| 成人av在线影院| 这里是久久伊人| 亚洲一区二区在线免费看| 视频在线观看国产精品| 欧美极品美女视频| 六月丁香综合在线视频| 欧美日韩专区在线| 亚洲欧美日韩国产另类专区| 成人av在线影院| 日韩一区二区免费在线观看| 久久成人久久爱| 中文字幕一区二区不卡| 国产91精品精华液一区二区三区 | 中文字幕不卡的av| 欧美一区二区三区视频免费播放 | 久久久精品国产99久久精品芒果| 欧亚一区二区三区| 97se狠狠狠综合亚洲狠狠| 精品一区二区免费视频| 午夜视频一区二区三区| 中文字幕日韩av资源站| 国产网站一区二区| 精品久久一二三区| 91精品国产一区二区| 在线免费不卡视频| 色综合天天天天做夜夜夜夜做| 国产a视频精品免费观看| 精一区二区三区| 麻豆成人91精品二区三区| 亚洲国产美女搞黄色| 亚洲视频小说图片| 国产精品美女久久久久aⅴ| www久久久久| 精品黑人一区二区三区久久 | 1区2区3区精品视频| 国产欧美一区二区精品仙草咪| 欧美大尺度电影在线| 日韩女同互慰一区二区| 制服丝袜激情欧洲亚洲| 欧美一区二区私人影院日本| 69堂成人精品免费视频| 7777女厕盗摄久久久| 欧美一区二区美女| 欧美mv和日韩mv的网站| 欧美成人一级视频| 久久影院视频免费| 国产日韩av一区| 国产精品久久久爽爽爽麻豆色哟哟| 中文文精品字幕一区二区| 中文在线资源观看网站视频免费不卡 | 欧美一级xxx| 日韩欧美一级在线播放| 日韩久久精品一区| 久久色成人在线| 中文字幕乱码久久午夜不卡| |精品福利一区二区三区| 亚洲另类在线一区| 亚洲不卡在线观看| 日本亚洲最大的色成网站www| 美女视频黄久久| 国产精品自拍三区| av男人天堂一区| 欧美在线不卡一区| 欧美一级片免费看| 久久综合久色欧美综合狠狠| 国产精品午夜在线| 亚洲综合av网| 琪琪一区二区三区| 国产成人av电影在线播放| 波多野结衣中文字幕一区| 91国产精品成人| 91麻豆精品国产自产在线| 精品国产乱码久久久久久久 | 欧美综合色免费| 日韩三级.com| 中文字幕中文字幕一区| 午夜影视日本亚洲欧洲精品| 精品一区二区三区久久| 9l国产精品久久久久麻豆| 欧美色图天堂网| 久久亚洲免费视频| 日韩毛片一二三区| 男人操女人的视频在线观看欧美| 国产精品资源在线观看| 在线视频国产一区| 精品乱人伦小说| 一区二区国产视频| 国产乱子伦一区二区三区国色天香| 在线视频国内一区二区| 国产婷婷精品av在线| 亚洲一区二区av电影| 国产成人免费av在线| 欧美日韩不卡一区二区| 中文字幕第一页久久| 青青国产91久久久久久| 91免费精品国自产拍在线不卡| 日韩片之四级片| 亚洲欧美日韩综合aⅴ视频| 精品一区二区三区欧美| 欧美午夜理伦三级在线观看| 欧美—级在线免费片| 麻豆精品久久久| 欧美亚洲国产bt| 中文字幕国产精品一区二区| 国产在线视频精品一区| 欧美日韩久久久一区| 国产精品―色哟哟| 免费在线观看不卡| 国产一区二区在线观看视频| 欧美日韩二区三区| 中文字幕乱码久久午夜不卡| 国产尤物一区二区在线| 欧美日韩午夜影院| 中文字幕一区二区三区不卡在线| 毛片av一区二区| 欧美亚洲国产bt| 国产精品天干天干在观线| 亚洲天堂成人在线观看| 国产老妇另类xxxxx| 欧美久久久久久蜜桃| 中文字幕字幕中文在线中不卡视频| 国产在线精品一区二区不卡了 | 99久久伊人精品| www精品美女久久久tv| 午夜不卡av在线| 成人深夜视频在线观看| 中文字幕免费观看一区| 激情国产一区二区| 91精品国产高清一区二区三区| 亚洲欧美自拍偷拍| 成人美女视频在线观看18| 日韩亚洲欧美一区| 亚洲一二三四在线观看| 成人av手机在线观看| 国产精品美女久久久久高潮| 国产成人av福利| 欧美mv和日韩mv的网站| 午夜精品一区二区三区电影天堂 | 亚洲三级久久久| 粉嫩一区二区三区性色av| 日韩三区在线观看| 舔着乳尖日韩一区| 欧美一三区三区四区免费在线看| 亚洲国产成人av网| 欧美视频一区二区三区| 夜夜爽夜夜爽精品视频| 精品视频资源站| 亚洲va在线va天堂| 欧美精品久久一区二区三区| 婷婷丁香久久五月婷婷| 日韩一区二区三区免费看| 日韩精品一二三四| 欧美亚洲一区二区在线| 中文字幕高清不卡| 99久久99久久免费精品蜜臀| 亚洲天堂福利av| 不卡欧美aaaaa| 亚洲国产毛片aaaaa无费看| 欧美日韩一区不卡| 性做久久久久久久免费看| 欧美成人精精品一区二区频| 国产伦理精品不卡| 欧美高清在线精品一区| 韩国av一区二区三区| 国产精品国产三级国产专播品爱网| 国产福利精品一区二区| 国产亚洲综合性久久久影院| 激情av综合网| 亚洲天堂中文字幕| 欧美日韩亚洲综合一区| 奇米影视7777精品一区二区| 中文字幕乱码久久午夜不卡| 91国偷自产一区二区开放时间 | www成人在线观看| 大陆成人av片| 亚洲精品视频一区二区| 日韩欧美一区二区视频| 国产一区二区美女| 国产精品免费看片| 色综合久久88色综合天天6| 日本欧美肥老太交大片| 精品国产乱子伦一区| 成人av动漫网站| 日本不卡中文字幕| 2020日本不卡一区二区视频| av高清久久久| 亚洲已满18点击进入久久| 欧美一卡二卡三卡| 成人黄色电影在线| 亚洲理论在线观看| 2017欧美狠狠色| 91视频在线看|