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

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

?? machine.c

?? Ho Chi Minh City University of Technology Computer Science Department Distributed Computing E
?? C
?? 第 1 頁 / 共 3 頁
字號:
  goto kcid_changed;int kupdate(int avenrun[3]){    kstat_t *ks;    kid_t nkcid;    int i;    int changed = 0;    static int ncpu = 0;    static kid_t kcid = 0;    kstat_named_t *kn;    /*     * 0. kstat_open     */    if (!kc)    {	kc = kstat_open();	if (!kc)	{	    perror("kstat_open ");	    quit(1);	}	changed = 1;	kcid = kc->kc_chain_id;    }    /* keep doing it until no more changes */  kcid_changed:    /*     * 1.  kstat_chain_update     */    nkcid = kstat_chain_update(kc);    if (nkcid)    {	/* UPDKCID will abort if nkcid is -1, so no need to check */	changed = 1;	kcid = nkcid;    }    UPDKCID(nkcid,0);    ks = kstat_lookup(kc, "unix", 0, "system_misc");    if (kstat_read(kc, ks, 0) == -1) {	perror("kstat_read");	quit(1);    }    /* load average */    kn = kstat_data_lookup(ks, "avenrun_1min");    if (kn)	avenrun[0] = kn->value.ui32;    kn = kstat_data_lookup(ks, "avenrun_5min");    if (kn)	avenrun[1] = kn->value.ui32;    kn = kstat_data_lookup(ks, "avenrun_15min");    if (kn)	avenrun[2] = kn->value.ui32;    /* nproc */    kn = kstat_data_lookup(ks, "nproc");    if (kn) {	nproc = kn->value.ui32;#ifdef NO_NPROC	if (nproc > maxprocs)	    reallocproc(2 * nproc);#endif    }    if (changed) {	/*	 * 2. get data addresses	 */	ncpu = 0;	kn = kstat_data_lookup(ks, "ncpus");	if (kn && kn->value.ui32 > ncpus) {	    ncpus = kn->value.ui32;	    cpu_ks = (kstat_t **) realloc (cpu_ks, ncpus * sizeof (kstat_t *));	    cpu_stat = (cpu_stat_t *) realloc (cpu_stat,			ncpus * sizeof (cpu_stat_t));	}	for (ks = kc->kc_chain; ks; 	     ks = ks->ks_next)	{	    if (strncmp(ks->ks_name, "cpu_stat", 8) == 0)	    {		nkcid = kstat_read(kc, ks, NULL);		/* if kcid changed, pointer might be invalid */		UPDKCID(nkcid, kcid);		cpu_ks[ncpu] = ks;		ncpu++;		if (ncpu > ncpus)		{		    fprintf(stderr, "kstat finds too many cpus: should be %d\n",			    ncpus);		    quit(1);		}	    }	}	/* note that ncpu could be less than ncpus, but that's okay */	changed = 0;    }    /*     * 3. get data     */    for (i = 0; i < ncpu; i++)    {	nkcid = kstat_read(kc, cpu_ks[i], &cpu_stat[i]);	/* if kcid changed, pointer might be invalid */	UPDKCID(nkcid, kcid);    }    /* return the number of cpus found */    return(ncpu);}#endif /* USE_KSTAT */voidget_system_info (struct system_info *si){  int avenrun[3];  static int freemem;  static int maxmem;  static int availrmem;  static int swapfs_minfree;  static int swap_total;  static int swap_free;  struct anoninfo anoninfo;  static long cp_time[CPUSTATES];  static long cp_old[CPUSTATES];  static long cp_diff[CPUSTATES];  register int j, i;#ifdef USE_KSTAT  kstat_t *ks;  kstat_named_t *kn;  int cpus_found;#else  struct cpu cpu;#endif  /* get the cp_time array */  for (j = 0; j < CPUSTATES; j++)    cp_time[j] = 0L;#ifdef USE_KSTAT  /* use kstat to upadte all processor information */  cpus_found = kupdate(avenrun);  for (i = 0; i < cpus_found; i++)    {      /* sum counters up to, but not including, wait state counter */      for (j = 0; j < CPU_WAIT; j++)	cp_time[j] += (long) cpu_stat[i].cpu_sysinfo.cpu[j];      /* add in wait state breakdown counters */      cp_time[CPUSTATE_IOWAIT] += (long) cpu_stat[i].cpu_sysinfo.wait[W_IO] +                                  (long) cpu_stat[i].cpu_sysinfo.wait[W_PIO];      cp_time[CPUSTATE_SWAP] += (long) cpu_stat[i].cpu_sysinfo.wait[W_SWAP];    }    /* avenrun */#if OSREV >= 55    ks = kstat_lookup(kc, "unix", 0, "system_pages");    if (kstat_read(kc, ks, 0) == -1) {	perror("kstat_read");	quit(1);    }#ifdef USE_ANONINFO    kn = kstat_data_lookup(ks, "availrmem");    if (kn)	availrmem = kn->value.ul;#endif    kn = kstat_data_lookup(ks, "freemem");    if (kn)	freemem = kn->value.ul;#endif /* OSREV >= 55 */#else /* !USE_KSTAT */  for (i = 0; i < ncpus; i++)    if (cpu_offset[i] != 0)    {      /* get struct cpu for this processor */      (void) getkval (cpu_offset[i], &cpu, sizeof (struct cpu), "cpu");      /* sum counters up to, but not including, wait state counter */      for (j = 0; j < CPU_WAIT; j++)	cp_time[j] += (long) cpu.cpu_stat.cpu_sysinfo.cpu[j];      /* add in wait state breakdown counters */      cp_time[CPUSTATE_IOWAIT] += (long) cpu.cpu_stat.cpu_sysinfo.wait[W_IO] +                                  (long) cpu.cpu_stat.cpu_sysinfo.wait[W_PIO];      cp_time[CPUSTATE_SWAP] += (long) cpu.cpu_stat.cpu_sysinfo.wait[W_SWAP];    }  /* get load average array */  (void) getkval (avenrun_offset, (int *) avenrun, sizeof (avenrun), "avenrun");#endif /* USE_KSTAT */  /* convert cp_time counts to percentages */  (void) percentages (CPUSTATES, cpu_states, cp_time, cp_old, cp_diff);   /* get mpid -- process id of last process */  if (kd)    (void) getkval(mpid_offset, &(si->last_pid), sizeof (si->last_pid), "mpid");  else    si->last_pid = -1;  /* convert load averages to doubles */  for (i = 0; i < 3; i++)    si->load_avg[i] = loaddouble (avenrun[i]);  /* get system wide main memory usage structure */#if 1  maxmem = sysconf(_SC_PHYS_PAGES);#else  (void) getkval (maxmem_offset, (int *) (&maxmem), sizeof (maxmem), "maxmem");#endif#if !defined(USE_KSTAT) || OSREV < 55  (void) getkval (freemem_offset, (int *) (&freemem), sizeof (freemem), "freemem");#endif  memory_stats[0] = pagetok (maxmem);  memory_stats[1] = 0;  memory_stats[2] = pagetok (freemem);#ifdef USE_ANONINFO  (void) getkval (anoninfo_offset, (int *) (&anoninfo), sizeof (anoninfo), "anoninfo");#if !defined(USE_KSTAT) || OSREV < 55  (void) getkval (availrmem_offset, (int *) (&availrmem), sizeof (availrmem), "availrmem");#endif  (void) getkval (swapfs_minfree_offset, (int *) (&swapfs_minfree), sizeof (swapfs_minfree), "swapfs_minfree");  memory_stats[3] = pagetok (anoninfo.ani_resv);  memory_stats[4] = pagetok (MAX ((int) (anoninfo.ani_max - anoninfo.ani_resv), 0) + availrmem - swapfs_minfree);#else  get_swapinfo(&swap_total, &swap_free);  memory_stats[3] = pagetok(swap_total - swap_free);  memory_stats[4] = pagetok(swap_free);#endif  /* set arrays and strings */  si->cpustates = cpu_states;  si->memory = memory_stats;}static struct handle handle;caddr_tget_process_info (		   struct system_info *si,		   struct process_select *sel,		   int (*compare) ()){  register int i;  register int total_procs;  register int active_procs;  register struct prpsinfo **prefp;  register struct prpsinfo *pp;  /* these are copied out of sel for speed */  int show_idle;  int show_system;  int show_uid;#ifndef USE_KSTAT  /* Get current number of processes */  /* Got this when calling system info if using kstat */  (void) getkval (nproc_offset, (int *) (&nproc), sizeof (nproc), "nproc");#endif  /* read all the proc structures */  getptable (pbase);  /* get a pointer to the states summary array */  si->procstates = process_states;  /* set up flags which define what we are going to select */  show_idle = sel->idle;  show_system = sel->system;  show_uid = sel->uid != -1;  /* count up process states and get pointers to interesting procs */  total_procs = 0;  active_procs = 0;  (void) memset (process_states, 0, sizeof (process_states));  prefp = pref;  for (pp = pbase, i = 0; i < nproc;       i++, pp = (struct prpsinfo *) ((char *) pp + PRPSINFOSIZE))    {      /*	 *  Place pointers to each valid proc structure in pref[].	 *  Process slots that are actually in use have a non-zero	 *  status field.  Processes with SSYS set are system	 *  processes---these get ignored unless show_sysprocs is set.	 */      if (pp->pr_state != 0 &&	  (show_system || ((pp->pr_flag & SSYS) == 0)))	{	  total_procs++;	  process_states[pp->pr_state]++;	  if ((!ZOMBIE(pp)) &&	      (show_idle || percent_cpu (pp) || (pp->pr_state == SRUN) || (pp->pr_state == SONPROC)) &&	      (!show_uid || pp->pr_uid == (uid_t) sel->uid))	    {	      *prefp++ = pp;	      active_procs++;	    }	}    }  /* if requested, sort the "interesting" processes */  if (compare != NULL)    qsort ((char *) pref, active_procs, sizeof (struct prpsinfo *), compare);  /* remember active and total counts */  si->p_total = total_procs;  si->p_active = active_procs;  /* pass back a handle */  handle.next_proc = pref;  handle.remaining = active_procs;  return ((caddr_t) & handle);}char fmt[MAX_COLS];			/* static area where result is built */char *format_next_process (		      caddr_t handle,		      char *(*get_userid) ()){  register struct prpsinfo *pp;  struct handle *hp;  register long cputime;  register double pctcpu;  char sb[10];  /* find and remember the next proc structure */  hp = (struct handle *) handle;  pp = *(hp->next_proc++);  hp->remaining--;  /* get the cpu usage and calculate the cpu percentages */  cputime = pp->pr_time.tv_sec;  pctcpu = percent_cpu (pp);  if (pp->pr_state == SONPROC && ncpus > 1)    sprintf(sb,"cpu%-2d", pp->pr_onpro); /* XXX large #s may overflow colums */  else    *sb = '\0';  /* format this entry */  sprintf (fmt,	   Proc_format,	   pp->pr_pid,	   (*get_userid) (pp->pr_uid),	   (u_short)pp->pr_fill < 999 ? (u_short)pp->pr_fill : 999,	   pp->pr_pri,	   pp->pr_nice - NZERO,	   format_k(SIZE_K(pp)),	   format_k(RSS_K(pp)),	   *sb ? sb : state_abbrev[pp->pr_state],	   format_time(cputime),	   pctcpu,	   pp->pr_fname);  /* return the result */  return (fmt);}/* * check_nlist(nlst) - checks the nlist to see if any symbols were not *		found.  For every symbol that was not found, a one-line *		message is printed to stderr.  The routine returns the *		number of symbols NOT found. */intcheck_nlist (register struct nlist *nlst){  register int i;  /* check to see if we got ALL the symbols we requested */  /* this will write one line to stderr for every symbol not found */  i = 0;  while (nlst->n_name != NULL)    {      if (nlst->n_type == 0)	{	  /* this one wasn't found */	  fprintf (stderr, "kernel: no symbol named `%s'\n", nlst->n_name);	  i = 1;	}      nlst++;    }  return (i);}/* *  getkval(offset, ptr, size, refstr) - get a value out of the kernel. *	"offset" is the byte offset into the kernel for the desired value, *  	"ptr" points to a buffer into which the value is retrieved, *  	"size" is the size of the buffer (and the object to retrieve), *  	"refstr" is a reference string used when printing error meessages, *	    if "refstr" starts with a '!', then a failure on read will not *  	    be fatal (this may seem like a silly way to do things, but I *  	    really didn't want the overhead of another argument). * */intgetkval (unsigned long offset,	 int *ptr,	 int size,	 char *refstr){  if (kvm_read (kd, offset, (char *) ptr, size) != size)    {      if (*refstr == '!')	{	  return (0);	}      else	{	  fprintf (stderr, "top: kvm_read for %s: %s\n", refstr, strerror(errno));	  quit (23);	}    }  return (1);}/* comparison routines for qsort *//* * There are currently four possible comparison routines.  main selects * one of these by indexing in to the array proc_compares. * * Possible keys are defined as macros below.  Currently these keys are * defined:  percent cpu, cpu ticks, process state, resident set size, * total virtual memory usage.  The process states are ordered as follows * (from least to most important):  WAIT, zombie, sleep, stop, start, run. * The array declaration below maps a process state index into a number * that reflects this ordering. *//* First, the possible comparison keys.  These are defined in such a way   that they can be merely listed in the source code to define the actual   desired ordering. */#define ORDERKEY_PCTCPU  if (dresult = percent_cpu (p2) - percent_cpu (p1),\			     (result = dresult > 0.0 ? 1 : dresult < 0.0 ? -1 : 0) == 0)#define ORDERKEY_CPTICKS if ((result = p2->pr_time.tv_sec - p1->pr_time.tv_sec) == 0)#define ORDERKEY_STATE   if ((result = (long) (sorted_state[p2->pr_state] - \			       sorted_state[p1->pr_state])) == 0)#define ORDERKEY_PRIO    if ((result = p2->pr_oldpri - p1->pr_oldpri) == 0)#define ORDERKEY_RSSIZE  if ((result = p2->pr_rssize - p1->pr_rssize) == 0)#define ORDERKEY_MEM     if ((result = (p2->pr_size - p1->pr_size)) == 0)/* Now the array that maps process state to a weight */unsigned char sorted_state[] ={  0,				/* not used		*/  3,				/* sleep		*/  6,				/* run			*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久久久久久久久久| 欧美大度的电影原声| 91麻豆精品国产91久久久资源速度| 欧美一区永久视频免费观看| 国产精品久久久久7777按摩| 日韩va欧美va亚洲va久久| 99久久免费视频.com| 欧美精品一区二区在线播放| 亚洲成人资源在线| 91啪亚洲精品| 国产日韩高清在线| 麻豆视频一区二区| 欧美视频中文字幕| 亚洲品质自拍视频| 成人三级伦理片| 欧美精品一区二区三区在线播放| 日韩精品国产精品| 在线观看av一区| 亚洲欧美二区三区| 成人免费高清在线| 中文av一区二区| 国产精品一区二区视频| 欧美精品一区男女天堂| 久久爱www久久做| 日韩一区二区在线播放| 秋霞成人午夜伦在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 日韩丝袜美女视频| 亚洲h在线观看| 欧洲精品中文字幕| 亚洲国产精品麻豆| 日本国产一区二区| 亚洲综合色噜噜狠狠| 色系网站成人免费| 亚洲综合激情小说| 欧美午夜宅男影院| 五月综合激情网| 欧美日韩大陆在线| 午夜视黄欧洲亚洲| 欧美一区二区视频免费观看| 日韩激情视频在线观看| 欧美一区二区三区免费视频| 蜜臀久久99精品久久久画质超高清 | 国产一区二区三区黄视频| 精品国产乱码久久久久久老虎 | 国产伦精品一区二区三区视频青涩 | 一区在线中文字幕| 91麻豆视频网站| 伊人一区二区三区| 欧美亚日韩国产aⅴ精品中极品| 亚洲午夜久久久| 日韩视频一区二区三区| 国产乱码精品一区二区三区av| 久久精品亚洲国产奇米99| 成人中文字幕合集| 一二三四区精品视频| 欧美一区永久视频免费观看| 国产精品1区2区| 日韩理论片网站| 日韩一级二级三级| 国产99久久久精品| 亚洲午夜一二三区视频| 精品国产乱码久久久久久蜜臀 | 久久国产欧美日韩精品| 26uuu另类欧美| 99久久久国产精品| 美女在线一区二区| 中文字幕一区二区三区乱码在线 | 久久亚洲精华国产精华液 | 伊人夜夜躁av伊人久久| 日韩欧美一区在线| 成人动漫一区二区三区| 午夜精品爽啪视频| 国产精品久久久久一区| 欧美一区二区三区男人的天堂| 国产aⅴ精品一区二区三区色成熟| 亚洲精品国产a久久久久久| 日韩精品资源二区在线| 在线观看日韩高清av| 极品少妇xxxx精品少妇偷拍| 亚洲精品中文字幕在线观看| 欧美成人三级电影在线| 色婷婷久久综合| 精品一区二区av| 亚洲免费观看高清完整版在线观看熊| 91精品国产一区二区三区 | 欧美一区二区三区爱爱| 国产精品福利av| 精品国产髙清在线看国产毛片| 国产成人av自拍| 日韩vs国产vs欧美| 自拍偷拍欧美精品| 国产视频一区二区三区在线观看 | 韩国一区二区三区| 亚洲激情图片小说视频| 久久精品一区八戒影视| 日韩亚洲欧美综合| 欧美体内she精视频| 99精品视频在线观看免费| 久久99国产精品免费| 午夜精品久久久久久久99水蜜桃 | 欧美日韩在线播放三区| 91视频com| 东方欧美亚洲色图在线| 国产精品影视在线| 国内国产精品久久| 麻豆精品一区二区av白丝在线| 一二三区精品视频| 一区二区三区中文字幕在线观看| 久久久精品综合| 久久综合国产精品| 欧美电影免费观看高清完整版在线| 欧美伊人久久大香线蕉综合69| 91麻豆精品一区二区三区| jlzzjlzz亚洲女人18| aaa欧美大片| 99久久精品一区二区| 97精品超碰一区二区三区| 91在线观看视频| 97精品视频在线观看自产线路二 | 国产精品99久久久久久久女警| 激情六月婷婷久久| 国产一区三区三区| 国产激情一区二区三区| 成人av中文字幕| 99麻豆久久久国产精品免费| 91亚洲永久精品| 91成人在线免费观看| 777久久久精品| 精品福利视频一区二区三区| 精品美女在线观看| 久久精品男人的天堂| 日韩伦理电影网| 亚洲国产aⅴ成人精品无吗| 天使萌一区二区三区免费观看| 日韩影院精彩在线| 国产精品538一区二区在线| 99久久777色| 精品视频在线免费观看| 欧美xxxx在线观看| 日本一二三不卡| 一区二区三区免费网站| 日韩在线观看一区二区| 国产在线播放一区| 日本电影欧美片| 日韩精品一区二区三区在线播放 | 丰满亚洲少妇av| 在线看不卡av| 欧美成人高清电影在线| 亚洲欧洲国产日韩| 日韩有码一区二区三区| 高清成人免费视频| 欧美日韩一区二区三区在线| 久久亚洲欧美国产精品乐播 | 99久久精品国产一区二区三区| 欧美视频一区二区三区在线观看| 精品福利视频一区二区三区| 中文字幕一区三区| 琪琪久久久久日韩精品| 91在线视频播放| 精品久久免费看| 亚洲制服欧美中文字幕中文字幕| 国产一区二区三区免费观看| 欧美日韩综合一区| 国产精品电影院| 六月婷婷色综合| 欧美吞精做爰啪啪高潮| 国产精品网站在线观看| 日本亚洲视频在线| 日本道在线观看一区二区| 国产校园另类小说区| 日韩av一区二区在线影视| 色婷婷亚洲婷婷| 国产欧美精品一区二区色综合朱莉 | 欧美亚洲综合久久| 欧美激情一区二区三区四区| 蜜桃av噜噜一区| 欧美日韩高清一区二区| 一区二区三区四区精品在线视频| 国产成人av一区二区三区在线| 3d动漫精品啪啪| 亚洲一区二区三区在线看| jvid福利写真一区二区三区| 国产欧美一区二区精品性色超碰| 免费在线看一区| 欧美乱妇一区二区三区不卡视频| 中文字幕佐山爱一区二区免费| 国产成人午夜片在线观看高清观看| 日韩一级免费观看| 美女一区二区三区| 69久久99精品久久久久婷婷 | 懂色av一区二区三区免费看| 欧美一区二区视频免费观看| 亚洲成人激情社区| 91福利视频在线| 亚洲一卡二卡三卡四卡无卡久久| 99精品国产热久久91蜜凸| 国产精品久久久久四虎| 99视频一区二区| 一区二区在线免费|