home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Resources / Utilities / Partition Logic 0.68 / partlogic-0.68.iso / system / headers / sys / process.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-10  |  1.8 KB  |  73 lines

  1. // 
  2. //  Visopsys
  3. //  Copyright (C) 1998-2007 J. Andrew McLaughlin
  4. //  
  5. //  This library is free software; you can redistribute it and/or modify it
  6. //  under the terms of the GNU Lesser General Public License as published by
  7. //  the Free Software Foundation; either version 2.1 of the License, or (at
  8. //  your option) any later version.
  9. //
  10. //  This library is distributed in the hope that it will be useful, but
  11. //  WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
  13. //  General Public License for more details.
  14. //
  15. //  You should have received a copy of the GNU Lesser General Public License
  16. //  along with this library; if not, write to the Free Software Foundation,
  17. //  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. //  process.h
  20. //
  21.  
  22. // This file contains definitions and structures for using and manipulating
  23. // processes in Visopsys.
  24.  
  25. #if !defined(_PROCESS_H)
  26.  
  27. #include <string.h>
  28.  
  29. #define MAX_PROCNAME_LENGTH  64
  30. #define MAX_PROCESSES        ((GDT_SIZE - RES_GLOBAL_DESCRIPTORS))
  31.  
  32. // An enumeration listing possible process states
  33. typedef enum {
  34.   proc_running, proc_ready, proc_waiting, proc_sleeping, proc_stopped,
  35.   proc_finished, proc_zombie
  36. } processState;
  37.  
  38. // An enumeration listing possible process types
  39. typedef enum {
  40.   proc_normal, proc_thread
  41. } processType;
  42.  
  43. typedef struct {
  44.   void *virtualAddress;
  45.   void *entryPoint;
  46.   void *code;
  47.   unsigned codeSize;
  48.   void *data;
  49.   unsigned dataSize;
  50.   unsigned imageSize;
  51.   char commandLine[MAXSTRINGLENGTH];
  52.   int argc;
  53.   char *argv[64];
  54.  
  55. } processImage;
  56.  
  57. typedef struct {
  58.   char processName[MAX_PROCNAME_LENGTH];
  59.   int userId;
  60.   int processId;
  61.   processType type;
  62.   int priority;
  63.   int privilege;
  64.   int parentProcessId;
  65.   int descendentThreads;
  66.   int cpuPercent;
  67.   processState state;
  68.  
  69. } process;
  70.  
  71. #define _PROCESS_H
  72. #endif
  73.