Skip to content

Instantly share code, notes, and snippets.

@boon-code
Created August 15, 2011 00:44
Show Gist options
  • Select an option

  • Save boon-code/1145526 to your computer and use it in GitHub Desktop.

Select an option

Save boon-code/1145526 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from multiprocessing import Process
from ctypes import CDLL
import sys
import os
libc = CDLL("libc.so.6")
prctl = libc.prctl
def f(name):
print('hello', name)
prctl(22, 1, 0)
print("some other text")
with open('some-file.txt', 'w') as f:
f.write("Hallo")
print("wrote text file")
a = 7
if __name__ == '__main__':
p = Process(target=f, args=('bob',))
p.start()
p.join()
print(p.exitcode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment