Skip to main content

Python module to check for system call numbers

Project description

What is it?

This is very simple code to get system call numbers from Python level.

Usage

Quite simple:

#!/usr/bin/python3

import system_calls

system_calls = system_calls.syscalls()

for test_call in ['openat', 'osf_uadmin', 'nosuchcall']:
    try:
        print(f"System call '{test_call}' has number: {system_calls[test_call]}")
    except system_calls.NoSuchSystemCall:
        print(f"No such system call '{test_call}' on any architecture")
    except system_calls.NotSupportedSystemCall:
        print(f"System call '{test_call}' is not supported on this "
              "architecture")

for test_call in ['openat', 'osf_uadmin', 'nosuchcall']:
    try:
        print(f"System call '{test_call}' on arm64 has number: "
              f"{system_calls.get(test_call, 'arm64')}")
    except system_calls.NoSuchSystemCall:
        print(f"No such system call '{test_call}' on any architecture")
    except system_calls.NotSupportedSystemCall:
        print(f"System call '{test_call}' is not supported on this "
              "architecture")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

system-calls-5.15.2.tar.gz (52.9 kB view hashes)

Uploaded Source

Built Distribution

system_calls-5.15.2-py3-none-any.whl (124.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page