Metadata-Version: 2.1
Name: system-calls
Version: 5.13.1
Summary: Python module to check for system call numbers
Home-page: https://github.com/hrw/python-syscalls
Author: Marcin Juszkiewicz
Author-email: marcin-python@juszkiewicz.com.pl
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/hrw/python-syscalls/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# What is it?

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

# Usage

Quite simple:

```python
#!/usr/bin/python3

import syscalls

system_calls = syscalls.syscalls()

for test_call in ['openat', 'osf_uadmin', 'nosuchcall']:
    try:
        print(f"System call '{test_call}' has number: {system_calls[test_call]}")
    except syscalls.NoSuchSystemCall:
        print(f"No such system call '{test_call}' on any architecture")
    except syscalls.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 syscalls.NoSuchSystemCall:
        print(f"No such system call '{test_call}' on any architecture")
    except syscalls.NotSupportedSystemCall:
        print(f"System call '{test_call}' is not supported on this "
              "architecture")
```


