diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-21 15:10:23 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-21 15:10:23 +0200 |
commit | 6f8da9534efd4b3833a77a10bff9d009a84dcf80 (patch) | |
tree | 05c2f51f1fa10aadc4ca930f307b1b1d21ebd22a /module/lib | |
parent | cleaned rslayer plugin (diff) | |
download | pyload-6f8da9534efd4b3833a77a10bff9d009a84dcf80.tar.xz |
Änderung: 1564:40817b13d8b3
Zweig: dev
Marke: tip
Nutzer: Cptn_Sandwich
Datum: Tue Jun 21 14:02:50 2011 +0200
Zusammenfassung: use process names on linux instead of "python"
Diffstat (limited to 'module/lib')
-rw-r--r-- | module/lib/rename_process.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/module/lib/rename_process.py b/module/lib/rename_process.py new file mode 100644 index 000000000..2aa270171 --- /dev/null +++ b/module/lib/rename_process.py @@ -0,0 +1,21 @@ +import sys +import os.path + + +def RenameProcess(new_name): + """ Renames the process calling the function to the given name. """ + if sys.platform != 'linux2': + print 'Unsupported platform' + return False + try: + import ctypes + is_64 = os.path.exists('/lib64/libc.so.6') + if is_64: + libc = ctypes.CDLL('/lib64/libc.so.6') + else: + libc = ctypes.CDLL('/lib/libc.so.6') + libc.prctl(15, new_name, 0, 0, 0) + return True + except: + print "rename failed" + return False |