00001 #ifndef OPIE_PROC_CTL_H 00002 #define OPIE_PROC_CTL_H 00003 00004 #include <sys/types.h> 00005 #include <unistd.h> 00006 #include <fcntl.h> 00007 #include <signal.h> 00008 00009 #include <qmap.h> 00010 00011 00012 struct ProcContainer { 00013 pid_t pid; 00014 int fd; 00015 int status; 00016 ProcContainer* prev; 00017 }; 00018 00019 class ProcCtl { 00020 private: 00021 ProcCtl(); 00022 public: 00023 ~ProcCtl(); 00024 00025 static ProcCtl* self(); 00026 int status(pid_t)const; 00027 void add( pid_t, int fd ); 00028 void remove( pid_t ); 00029 void remove( ProcContainer ); 00030 private: 00031 static void signal_handler(int); 00032 static ProcContainer* m_last; 00033 static ProcCtl* m_self; 00034 00035 }; 00036 00037 #endif
1.4.2