add naive unpythonic return type inference to function parsing

This commit is contained in:
2025-09-07 20:12:39 +05:30
parent c0559639f2
commit 1118e4fcd6
3 changed files with 96 additions and 114 deletions

View File

@ -1,11 +1,17 @@
from pythonbpf.decorators import bpf, section
from ctypes import c_void_p, c_int32
from ctypes import c_void_p, c_int64, c_int32
@bpf
@section("tracepoint/syscalls/sys_enter_execve")
def hello(ctx: c_void_p) -> c_int32:
print("Hello, World!")
print("entered")
return c_int32(0)
@bpf
@section("tracepoint/syscalls/sys_exit_execve")
def hello_again(ctx: c_void_p) -> c_int64:
print("exited")
return c_int64(0)
LICENSE = "GPL"