Renames the process calling the function to the given name.
(new_name)
| 1 | import sys |
| 2 | |
| 3 | def 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 |
no outgoing calls
no test coverage detected