예제 #1
0
파일: _pssunos.py 프로젝트: 2089764/psutil
 def terminal(self):
     hit_enoent = False
     tty = wrap_exceptions(
         cext.proc_basic_info(self.pid)[0])
     if tty != cext.PRNODEV:
         for x in (0, 1, 2, 255):
             try:
                 return os.readlink('/proc/%d/path/%d' % (self.pid, x))
             except OSError as err:
                 if err.errno == errno.ENOENT:
                     hit_enoent = True
                     continue
                 raise
     if hit_enoent:
         # raise NSP if the process disappeared on us
         os.stat('/proc/%s' % self.pid)
예제 #2
0
 def terminal(self):
     hit_enoent = False
     tty = wrap_exceptions(
         cext.proc_basic_info(self.pid)[0])
     if tty != cext.PRNODEV:
         for x in (0, 1, 2, 255):
             try:
                 return os.readlink('/proc/%d/path/%d' % (self.pid, x))
             except OSError:
                 err = sys.exc_info()[1]
                 if err.errno == errno.ENOENT:
                     hit_enoent = True
                     continue
                 raise
     if hit_enoent:
         # raise NSP if the process disappeared on us
         os.stat('/proc/%s' % self.pid)
예제 #3
0
파일: _pssunos.py 프로젝트: ztop/psutil
 def status(self):
     code = cext.proc_basic_info(self.pid)[6]
     # XXX is '?' legit? (we're not supposed to return it anyway)
     return PROC_STATUSES.get(code, '?')
예제 #4
0
파일: _pssunos.py 프로젝트: ztop/psutil
 def memory_info(self):
     ret = cext.proc_basic_info(self.pid)
     rss, vms = ret[1] * 1024, ret[2] * 1024
     return _common.pmem(rss, vms)
예제 #5
0
파일: _pssunos.py 프로젝트: ztop/psutil
 def ppid(self):
     return cext.proc_basic_info(self.pid)[0]
예제 #6
0
파일: _pssunos.py 프로젝트: ztop/psutil
 def num_threads(self):
     return cext.proc_basic_info(self.pid)[5]
예제 #7
0
파일: _pssunos.py 프로젝트: ztop/psutil
 def create_time(self):
     return cext.proc_basic_info(self.pid)[3]
예제 #8
0
 def status(self):
     code = cext.proc_basic_info(self.pid)[6]
     # XXX is '?' legit? (we're not supposed to return it anyway)
     return PROC_STATUSES.get(code, '?')
예제 #9
0
 def memory_info(self):
     ret = cext.proc_basic_info(self.pid)
     rss, vms = ret[1] * 1024, ret[2] * 1024
     return _common.pmem(rss, vms)
예제 #10
0
 def ppid(self):
     return cext.proc_basic_info(self.pid)[0]
예제 #11
0
 def num_threads(self):
     return cext.proc_basic_info(self.pid)[5]
예제 #12
0
 def create_time(self):
     return cext.proc_basic_info(self.pid)[3]