示例#1
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 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]