Skip to content

Instantly share code, notes, and snippets.

@jld
Created March 16, 2016 21:43
Show Gist options
  • Select an option

  • Save jld/ebb64b56ab80d7f55ae7 to your computer and use it in GitHub Desktop.

Select an option

Save jld/ebb64b56ab80d7f55ae7 to your computer and use it in GitHub Desktop.
import ctypes
libc = ctypes.CDLL("libc.so.6", use_errno = True)
if __name__ == '__main__':
set_rv = libc.prctl(22, 2, 0)
set_errno = ctypes.get_errno()
print("prctl(PR_SET_SECCOMP, 2, NULL) = %d errno %d" % (set_rv, set_errno))
get_rv = libc.prctl(21)
print("prctl(PR_GET_SECCOMP) = %d" % get_rv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment