[BACK]Return to sysinfo.h CVS log [TXT][DIR] Up to [local] / prex / include / prex

Annotation of prex/include/prex/sysinfo.h, Revision 1.1

1.1     ! nbrk        1: /*
        !             2:  * Copyright (c) 2007, Kohsuke Ohtani
        !             3:  * All rights reserved.
        !             4:  *
        !             5:  * Redistribution and use in source and binary forms, with or without
        !             6:  * modification, are permitted provided that the following conditions
        !             7:  * are met:
        !             8:  * 1. Redistributions of source code must retain the above copyright
        !             9:  *    notice, this list of conditions and the following disclaimer.
        !            10:  * 2. Redistributions in binary form must reproduce the above copyright
        !            11:  *    notice, this list of conditions and the following disclaimer in the
        !            12:  *    documentation and/or other materials provided with the distribution.
        !            13:  * 3. Neither the name of the author nor the names of any co-contributors
        !            14:  *    may be used to endorse or promote products derived from this software
        !            15:  *    without specific prior written permission.
        !            16:  *
        !            17:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
        !            18:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            19:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            20:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
        !            21:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            22:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            23:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            24:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            25:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            26:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            27:  * SUCH DAMAGE.
        !            28:  */
        !            29:
        !            30: #ifndef _PREX_SYSINFO_H
        !            31: #define _PREX_SYSINFO_H
        !            32:
        !            33: /*
        !            34:  * Data type for sys_info()
        !            35:  */
        !            36: #define INFO_KERNEL    1
        !            37: #define INFO_MEMORY    2
        !            38: #define INFO_THREAD    3
        !            39: #define INFO_DEVICE    4
        !            40: #define INFO_TIMER     5
        !            41:
        !            42: #define _KSTRLN                12
        !            43:
        !            44: struct info_kernel {
        !            45:        char    sysname[_KSTRLN];       /* Kernel name */
        !            46:        char    version[_KSTRLN];       /* Version level */
        !            47:        char    blddate[_KSTRLN];       /* Build date */
        !            48:        char    machine[_KSTRLN];       /* Architecture/platform */
        !            49:        char    hostname[_KSTRLN];      /* Host name */
        !            50: };
        !            51:
        !            52: /*
        !            53:  * Memory information
        !            54:  */
        !            55: struct info_memory {
        !            56:        size_t  total;          /* total memory size in bytes */
        !            57:        size_t  free;           /* current free memory size in bytes */
        !            58: };
        !            59:
        !            60: /*
        !            61:  * Thread information
        !            62:  */
        !            63: struct info_thread {
        !            64:        u_long  cookie;         /* index cookie - 0 for first thread */
        !            65:        int     policy;         /* scheduling policy */
        !            66:        int     prio;           /* current priority */
        !            67:        u_int   time;           /* total running time */
        !            68:        task_t  task;           /* task id */
        !            69:        char    taskname[MAXTASKNAME];  /* task name */
        !            70:        char    slpevt[MAXEVTNAME];     /* sleep event */
        !            71: };
        !            72:
        !            73: /*
        !            74:  * Device information
        !            75:  */
        !            76: struct info_device {
        !            77:        u_long  cookie;         /* index cookie - 0 for first thread */
        !            78:        device_t id;            /* device id */
        !            79:        int     flags;          /* device characteristics flags */
        !            80:        char    name[MAXDEVNAME]; /* device name */
        !            81: };
        !            82:
        !            83: /*
        !            84:  * Device flags
        !            85:  */
        !            86: #define DF_CHR         0x00000001      /* character device */
        !            87: #define DF_BLK         0x00000002      /* block device */
        !            88: #define DF_RDONLY      0x00000004      /* read only device */
        !            89: #define DF_REM         0x00000008      /* removable device */
        !            90:
        !            91: /*
        !            92:  * Timer informations
        !            93:  */
        !            94: struct info_timer {
        !            95:        int     hz;             /* clock frequency */
        !            96: };
        !            97:
        !            98: #endif /* !_PREX_SYSINFO_H */

CVSweb