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

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

?? machine.c

?? Ho Chi Minh City University of Technology Computer Science Department Distributed Computing E
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * top - a top users display for Unix * * SYNOPSIS:  Any Sun running SunOS 5.x (Solaris 2.x) * * DESCRIPTION: * This is the machine-dependent module for SunOS 5.x (Solaris 2). * There is some support for MP architectures. * This makes top work on the following systems: *         SunOS 5.0 (not tested) *         SunOS 5.1 *         SunOS 5.2 *         SunOS 5.3 *         SunOS 5.4 *         SunOS 5.5 *         SunOS 5.6 *         SunOS 5.7 (beta) * *     Tested on a SPARCclassic with SunOS 5.1, using gcc-2.3.3, and *     SPARCsystem 600 with SunOS 5.2, using Sun C * * LIBS: -lelf -lkvm -lkstat * * CFLAGS: -DHAVE_GETOPT -DORDER -DHAVE_STRERROR * * * AUTHORS:      Torsten Kasch 		<torsten@techfak.uni-bielefeld.de> *               Robert Boucher		<boucher@sofkin.ca> * CONTRIBUTORS: Marc Cohen 		<marc@aai.com> *               Charles Hedrick 	<hedrick@geneva.rutgers.edu> *	         William L. Jones 	<jones@chpc> *               Petri Kutvonen         <kutvonen@cs.helsinki.fi> *	         Casper Dik             <casper.dik@sun.com> *               Tim Pugh               <tpugh@oce.orst.edu> */#define _KMEMUSER#if (OSREV >= 54)#define SOLARIS24#endif#if (OSREV == 551)#undef OSREV#define OSREV 55#endif#define USE_NEW_PROC#if defined(USE_NEW_PROC) && OSREV >= 56#define _STRUCTURED_PROC 1#define prpsinfo psinfo#include <sys/procfs.h>#define pr_fill pr_nlwp/* These require an ANSI C compiler "Reisser cpp" doesn't like this */#define pr_state pr_lwp.pr_state#define pr_oldpri pr_lwp.pr_oldpri#define pr_nice pr_lwp.pr_nice#define pr_pri pr_lwp.pr_pri#define pr_onpro pr_lwp.pr_onpro#define ZOMBIE(p)	((p)->pr_nlwp == 0)#define SIZE_K(p)	((p)->pr_size)#define RSS_K(p)	((p)->pr_rssize)#else#undef USE_NEW_PROC#define ZOMBIE(p)	((p)->pr_zomb)#define SIZE_K(p)	((p)->pr_bysize/1024)#define RSS_K(p)	((p)->pr_byrssize/1024)#define pr_onpro 	pr_filler[5]#endif#include "top.h"#include "machine.h"#include "utils.h"#include <stdio.h>#include <fcntl.h>#include <unistd.h>#include <stdlib.h>#include <errno.h>#include <dirent.h>#include <nlist.h>#include <string.h>#include <kvm.h>#include <sys/types.h>#include <sys/param.h>#include <sys/signal.h>#include <sys/fault.h>#include <sys/sysinfo.h>#include <sys/sysmacros.h>#include <sys/syscall.h>#include <sys/user.h>#include <sys/proc.h>#include <sys/procfs.h>#include <sys/vm.h>#include <sys/var.h>#include <sys/cpuvar.h>#include <sys/file.h>#include <sys/time.h>#include <sys/priocntl.h>#include <sys/tspriocntl.h>#include <sys/processor.h>#include <sys/swap.h>#include <vm/anon.h>#include <math.h>#if OSREV >= 53#define USE_KSTAT#endif#ifdef USE_KSTAT#include <kstat.h>/* * Some kstats are fixed at 32 bits, these will be specified as ui32; some * are "natural" size (32 bit on 32 bit Solaris, 64 on 64 bit Solaris * we'll make those unsigned long) * Older Solaris doesn't define KSTAT_DATA_UINT32, those are always 32 bit. */# ifndef KSTAT_DATA_UINT32#  define ui32 ul# endif#endif#define UNIX "/dev/ksyms"#define KMEM "/dev/kmem"#define PROCFS "/proc"#define CPUSTATES     5#ifndef PRIO_MIN#define PRIO_MIN	-20#endif#ifndef PRIO_MAX#define PRIO_MAX	20#endif#ifndef FSCALE#define FSHIFT  8		/* bits to right of fixed binary point */#define FSCALE  (1<<FSHIFT)#endif /* FSCALE */#define loaddouble(la) ((double)(la) / FSCALE)#define dbl_align(x)	(((unsigned long)(x)+(sizeof(double)-1)) & \						~(sizeof(double)-1))#ifdef SOLARIS24    /*     * snarfed from <sys/procfs.h>:     * The following percent numbers are 16-bit binary     * fractions [0 .. 1] with the binary point to the     * right of the high-order bit (one == 0x8000)     */#define percent_cpu(pp) (((double)pp->pr_pctcpu)/0x8000*100)#define weighted_cpu(pp) (*(double *)dbl_align(pp->pr_filler))#else#define percent_cpu(pp) (*(double *)dbl_align(&pp->pr_filler[0]))#define weighted_cpu(pp) (*(double *)dbl_align(&pp->pr_filler[2]))#endif/* definitions for indices in the nlist array */#define X_V			 0#define X_MPID			 1#define X_ANONINFO		 2#define X_MAXMEM		 3#define X_SWAPFS_MINFREE	 4#define X_FREEMEM		 5#define X_AVAILRMEM		 6#define X_AVENRUN		 7#define X_CPU			 8#define X_NPROC			 9#define X_NCPUS		   	10static struct nlist nlst[] ={  {"v"},			/* 0 */	/* replaced by dynamic allocation */  {"mpid"},			/* 1 */#if OSREV >= 56  /* this structure really has some extra fields, but the first three match */  {"k_anoninfo"},		/* 2 */#else  {"anoninfo"},			/* 2 */#endif  {"maxmem"},			/* 3 */ /* use sysconf */  {"swapfs_minfree"},		/* 4 */	/* used only w/ USE_ANONINFO */  {"freemem"},			/* 5 */	/* available from kstat >= 2.5 */  {"availrmem"},		/* 6 */	/* available from kstat >= 2.5 */  {"avenrun"},			/* 7 */ /* available from kstat */  {"cpu"},			/* 8 */ /* available from kstat */  {"nproc"},			/* 9 */ /* available from kstat */  {"ncpus"},			/* 10 */ /* available from kstat */  {0}};static unsigned long avenrun_offset;static unsigned long mpid_offset;#ifdef USE_KSTAT#define NO_NPROCstatic kstat_ctl_t *kc = NULL;static kstat_t **cpu_ks;static cpu_stat_t *cpu_stat;#elsestatic unsigned long *cpu_offset;#endifstatic unsigned long nproc_offset;static unsigned long freemem_offset;static unsigned long maxmem_offset;static unsigned long availrmem_offset;static unsigned long swapfs_minfree_offset;static unsigned long anoninfo_offset;static void reallocproc(int n);static int maxprocs;/* get_process_info passes back a handle.  This is what it looks like: */struct handle  {    struct prpsinfo **next_proc;/* points to next valid proc pointer */    int remaining;		/* number of pointers remaining */  };/* * Structure for keeping track of CPU times from last time around * the program.  We keep these things in a hash table, which is * recreated at every cycle. */struct oldproc  {    pid_t oldpid;    double oldtime;    double oldpct;  };int oldprocs;			/* size of table */#define HASH(x) ((x << 1) % oldprocs)/* * GCC assumes that all doubles are aligned.  Unfortunately it * doesn't round up the structure size to be a multiple of 8. * Thus we'll get a coredump when going through array.  The * following is a size rounded up to 8. */#define PRPSINFOSIZE dbl_align(sizeof(struct prpsinfo))/* *  These definitions control the format of the per-process area */static char header[] ="  PID X        THR PRI NICE  SIZE   RES STATE   TIME    CPU COMMAND";/* 0123456   -- field to fill in starts at header+6 */#define UNAME_START 6#define Proc_format \        "%5d %-8.8s %3d %3d %4d %5s %5s %-5s %6s %5.2f%% %s"/* process state names for the "STATE" column of the display *//* the extra nulls in the string "run" are for adding a slash and   the processor number when needed */char *state_abbrev[] ={"", "sleep", "run", "zombie", "stop", "start", "cpu", "swap"};int process_states[8];char *procstatenames[] ={  "", " sleeping, ", " running, ", " zombie, ", " stopped, ",  " starting, ", " on cpu, ", " swapped, ",  NULL};int cpu_states[CPUSTATES];char *cpustatenames[] ={"idle", "user", "kernel", "iowait", "swap", NULL};#define CPUSTATE_IOWAIT 3#define CPUSTATE_SWAP   4/* these are for detailing the memory statistics */int memory_stats[5];char *memorynames[] ={"K real, ", "K active, ", "K free, ", "K swap in use, ", "K swap free", NULL};/* these are names given to allowed sorting orders -- first is default */char *ordernames[] = {"cpu", "size", "res", "time", NULL};/* forward definitions for comparison functions */int compare_cpu();int compare_size();int compare_res();int compare_time();int (*proc_compares[])() = {    compare_cpu,    compare_size,    compare_res,    compare_time,    NULL };kvm_t *kd;static DIR *procdir;static int nproc;static int ncpus;/* these are for keeping track of the proc array */static int bytes;static struct prpsinfo *pbase;static struct prpsinfo **pref;static struct oldproc *oldbase;/* pagetok function is really a pointer to an appropriate function */static int pageshift;static int (*p_pagetok) ();#define pagetok(size) ((*p_pagetok)(size))/* useful externals */extern char *myname;extern int check_nlist ();extern int gettimeofday ();extern int getkval ();extern void perror ();extern void getptable ();extern void quit ();extern int nlist ();int pagetok_none(int size){    return(size);}int pagetok_left(int size){    return(size << pageshift);}int pagetok_right(int size){    return(size >> pageshift);}intmachine_init (struct statics *statics){    static struct var v;    struct oldproc *op, *endbase;    int i;#ifndef USE_KSTAT    int offset;#endif    /* perform the kvm_open */    kd = kvm_open (NULL, NULL, NULL, O_RDONLY, "top");    /*     * turn off super group/user privs - but beware; we might     * want the privs back later and we still have a fd to     * /dev/kmem open so we can't use setgid()/setuid() as that     * would allow a debugger to attach to this process. CD     */    setegid(getgid());    seteuid(getuid()); /* super user not needed for NEW_PROC */    /* fill in the statics information */    statics->procstate_names = procstatenames;    statics->cpustate_names = cpustatenames;    statics->memory_names = memorynames;    statics->order_names = ordernames;    /* test kvm_open return value */    if (kd == NULL)      {	perror ("kvm_open");#ifndef USE_KSTAT	return (-1);#endif      }    if (kd)      {      if (kvm_nlist (kd, nlst) < 0)        {	  perror ("kvm_nlist");	  return (-1);        }      if (check_nlist (nlst) != 0)        return (-1);      }#ifndef NO_NPROC    /* NPROC Tuning parameter for max number of processes */    (void) getkval (nlst[X_V].n_value, &v, sizeof (struct var), nlst[X_V].n_name);    nproc = v.v_proc;    reallocproc(nproc);#endif    /* stash away certain offsets for later use */    mpid_offset = nlst[X_MPID].n_value;    nproc_offset = nlst[X_NPROC].n_value;    avenrun_offset = nlst[X_AVENRUN].n_value;    anoninfo_offset = nlst[X_ANONINFO].n_value;    freemem_offset = nlst[X_FREEMEM].n_value;    maxmem_offset = nlst[X_MAXMEM].n_value;    availrmem_offset = nlst[X_AVAILRMEM].n_value;    swapfs_minfree_offset = nlst[X_SWAPFS_MINFREE].n_value;#ifndef USE_KSTAT    (void) getkval (nlst[X_NCPUS].n_value, (int *) (&ncpus),		    sizeof (ncpus), "ncpus");    cpu_offset = (unsigned long *) malloc (ncpus * sizeof (unsigned long));    for (i = offset = 0; i < ncpus; offset += sizeof(unsigned long)) {        (void) getkval (nlst[X_CPU].n_value + offset,                        &cpu_offset[i], sizeof (unsigned long),                        nlst[X_CPU].n_name );        if (cpu_offset[i] != 0)            i++;    }#endif    /* calculate pageshift value */    i = sysconf(_SC_PAGESIZE);    pageshift = 0;    while ((i >>= 1) > 0)    {	pageshift++;    }    /* calculate an amount to shift to K values */    /* remember that log base 2 of 1024 is 10 (i.e.: 2^10 = 1024) */    pageshift -= 10;    /* now determine which pageshift function is appropriate for the        result (have to because x << y is undefined for y < 0) */    if (pageshift > 0)    {	/* this is the most likely */	p_pagetok = pagetok_left;    }    else if (pageshift == 0)    {	p_pagetok = pagetok_none;    }    else    {	p_pagetok = pagetok_right;	pageshift = -pageshift;    }    if (!(procdir = opendir (PROCFS)))      {	(void) fprintf (stderr, "Unable to open %s\n", PROCFS);	return (-1);      }    if (chdir (PROCFS))      {				/* handy for later on when we're reading it */	(void) fprintf (stderr, "Unable to chdir to %s\n", PROCFS);	return (-1);      }    /* all done! */    return (0);  }char *format_header (register char *uname_field){  register char *ptr;  ptr = header + UNAME_START;  while (*uname_field != '\0')    *ptr++ = *uname_field++;  return (header);}#ifdef USE_KSTAT#define UPDKCID(nk,ok) \if (nk == -1) { \  perror("kstat_read "); \  quit(1); \} \if (nk != ok)\

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费国产在线| 午夜av一区二区| 欧美精品一卡两卡| 成人精品国产免费网站| 久久国产免费看| 国产精品人人做人人爽人人添| 欧美高清精品3d| 91老司机福利 在线| 成人午夜av影视| 国产高清成人在线| 久久超级碰视频| 裸体在线国模精品偷拍| 亚洲综合久久av| 亚洲自拍偷拍麻豆| 亚洲午夜三级在线| 午夜欧美大尺度福利影院在线看| 亚洲免费观看在线视频| 国产精品美女久久久久久久网站| 久久久噜噜噜久久中文字幕色伊伊| 欧美人动与zoxxxx乱| 欧美视频在线一区二区三区| 精品视频在线看| 欧美日韩精品一区二区三区| 欧美日韩国产高清一区| 日韩亚洲欧美一区| 欧美亚一区二区| 日韩精品一区二区三区视频在线观看| 制服丝袜激情欧洲亚洲| 26uuuu精品一区二区| 欧美高清在线一区二区| 一区二区免费看| 捆绑变态av一区二区三区| 国产福利一区二区三区| 99视频国产精品| 欧美一区二区视频在线观看2022| 日韩欧美你懂的| 亚洲日本韩国一区| 天堂一区二区在线| 男女视频一区二区| 国产盗摄女厕一区二区三区| 色综合一区二区| 欧美一级生活片| 中文字幕一区三区| 午夜精品123| 国产aⅴ精品一区二区三区色成熟| 色哟哟欧美精品| 精品国产乱码久久久久久久| 国产精品久久久久桃色tv| 日韩中文欧美在线| www.日韩大片| 久久免费视频色| 午夜视频在线观看一区二区三区| 国产乱码精品一区二区三区五月婷| 色综合久久中文字幕| 久久日一线二线三线suv| 亚洲欧美国产高清| 国产成人av电影在线| 69精品人人人人| 亚洲成人精品一区二区| 色哟哟在线观看一区二区三区| 精品乱人伦一区二区三区| 亚洲高清视频在线| 欧美优质美女网站| 亚洲视频一二区| 99久久久免费精品国产一区二区| www久久久久| 国产精一品亚洲二区在线视频| 精品国产不卡一区二区三区| 五月天久久比比资源色| 91香蕉视频在线| 亚洲天堂中文字幕| 一本久久a久久精品亚洲| 日韩二区三区四区| 日韩精品一区二区三区在线播放| 日本欧美在线观看| 26uuu欧美日本| 不卡av在线免费观看| 亚洲视频一区二区免费在线观看| 91麻豆蜜桃一区二区三区| 亚洲欧洲99久久| 欧美综合在线视频| 蜜桃一区二区三区四区| 7777精品伊人久久久大香线蕉 | 日韩欧美电影一二三| 亚洲成人av在线电影| 91精品国模一区二区三区| 麻豆精品视频在线| 国产精品久久精品日日| 在线观看日韩电影| 激情综合色播激情啊| 国产精品乱码一区二三区小蝌蚪| 在线亚洲免费视频| 久久疯狂做爰流白浆xx| 中文字幕在线一区二区三区| 精品视频在线看| 东方aⅴ免费观看久久av| 日韩精品高清不卡| 国产精品美女久久久久久久| 欧美精品乱人伦久久久久久| 高清日韩电视剧大全免费| 亚洲二区在线视频| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 91在线视频官网| 日韩在线一二三区| 亚洲欧美国产高清| 欧美国产视频在线| 日韩欧美亚洲另类制服综合在线| 色噜噜偷拍精品综合在线| 激情综合色综合久久| 日韩不卡手机在线v区| 亚洲欧美色图小说| 国产欧美精品在线观看| 欧美一区二区啪啪| 欧美性大战久久久久久久蜜臀| 成人自拍视频在线观看| 青青草97国产精品免费观看无弹窗版 | 欧美久久久久久蜜桃| 99精品视频一区| 一本一本大道香蕉久在线精品| 日韩视频一区在线观看| 97久久精品人人爽人人爽蜜臀| 国产精品中文字幕日韩精品| 蜜臀av性久久久久蜜臀aⅴ | 国产一区二区h| 国产精品夜夜嗨| 高清久久久久久| 日本韩国视频一区二区| 91蜜桃在线观看| 91搞黄在线观看| 欧美美女网站色| 日韩欧美成人一区| 久久综合999| 国产精品萝li| 日韩精品亚洲专区| 国产麻豆一精品一av一免费| 国产精品影视网| 96av麻豆蜜桃一区二区| 欧洲精品一区二区三区在线观看| 欧美性猛片aaaaaaa做受| 91精品国产高清一区二区三区蜜臀| 欧美一区二区精品久久911| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲桃色在线一区| 日韩成人午夜电影| 高清成人在线观看| 欧洲在线/亚洲| 久久久精品中文字幕麻豆发布| 中文字幕一区二区三| 日韩av一区二区在线影视| 成人av网址在线观看| 欧美肥妇bbw| 亚洲永久精品大片| 国产在线不卡一卡二卡三卡四卡| 国产女人18毛片水真多成人如厕 | www.99精品| 日韩三级免费观看| 夜夜爽夜夜爽精品视频| 韩国一区二区在线观看| 欧美色区777第一页| 国产精品久久久久久久久果冻传媒| 日本网站在线观看一区二区三区 | 一区二区视频在线| 懂色av中文一区二区三区| 亚洲午夜精品久久久久久久久| 国产成人高清在线| 国产亚洲精品免费| 韩国女主播一区| 日韩美女一区二区三区四区| 亚洲不卡在线观看| 欧美在线不卡一区| 亚洲色图欧洲色图婷婷| 成人app网站| 国产精品成人一区二区三区夜夜夜| 九一九一国产精品| 精品嫩草影院久久| 免费视频最近日韩| 日韩欧美中文字幕精品| 激情小说亚洲一区| 欧美国产精品v| 在线免费精品视频| 亚州成人在线电影| 日韩欧美自拍偷拍| 成人深夜在线观看| 国产精品电影院| 在线观看91av| 国产一区二区毛片| 亚洲欧洲韩国日本视频| 欧美日韩黄色一区二区| 毛片av中文字幕一区二区| 久久日韩粉嫩一区二区三区| 成人av在线电影| 免费成人美女在线观看.| 久久久精品国产免大香伊| 懂色av一区二区三区蜜臀| 亚洲精品欧美综合四区| 这里是久久伊人| 91在线国产福利| 欧美午夜视频网站| 九九九久久久精品| 亚洲精品免费电影|