Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Change clients/user/syscall.* to register system call hook structures, instead of heap-allocating them #55

Open
pgoodman opened this issue Nov 1, 2014 · 2 comments

Comments

@pgoodman
Copy link
Member

pgoodman commented Nov 1, 2014

This will bring the design closer to how the in-progress wrap_func tool is working. Should also rename things so that there is an explicit wrap_syscall tool/client. This move would mean getting rid of unnecessary heap allocations and allocators, and would potentially make the API nicer overall.

@pgoodman
Copy link
Member Author

Double check to see if this makes sense w.r.t. the actual closure pointer and delete pointer that get passed along as well. It might be that this isn't actually a tenable design.

Alternatively, this might be worth seeing as: wrapping system calls, just as functions are wrapped (i.e. in a type-specific way) rather than hooking pre/post. Wrapping would provide some really nice flexibility in terms of having the variables available on the stack instead of having to depend on TLS. Wrapping could be made to work for arbitrary syscalls by passing the syscall function six uintptr_t types in the case of unspecified syscalls, but passing the correct values along in the well-typed case.

@pgoodman
Copy link
Member Author

One issue is sigreturn and rt_sigreturn. These take the stack pointer as the argument.

I think this motivates the continued use of distinct before/after wrappers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant