MCPcopy Index your code
hub / github.com/pyload/pyload / renameProcess

Function renameProcess

module/lib/rename_process.py:3–14  ·  view source on GitHub ↗

Renames the process calling the function to the given name.

(new_name)

Source from the content-addressed store, hash-verified

1import sys
2
3def renameProcess(new_name):
4 """ Renames the process calling the function to the given name. """
5 if sys.platform != 'linux2':
6 return False
7 try:
8 from ctypes import CDLL
9 libc = CDLL('libc.so.6')
10 libc.prctl(15, new_name, 0, 0, 0)
11 return True
12 except Exception, e:
13 #print "Rename process failed", e
14 return False

Callers 2

__init__Method · 0.90
pyLoadGui.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected