mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-31 23:11:09 +00:00
linux: Introduce INTERNAL_VSYSCALL
Add an INTERNAL_VSYSCALL() macro that makes a vDSO call, falling back to a regular syscall, but without setting errno. Instead, the return value is plumbed straight out of the macro. Signed-off-by: Evan Green <evan@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
parent
426d0e1aa8
commit
c6c33339b4
@ -53,4 +53,16 @@
|
||||
sc_ret; \
|
||||
})
|
||||
|
||||
#define INTERNAL_VSYSCALL(name, nr, args...) \
|
||||
({ \
|
||||
long int sc_ret = -ENOSYS; \
|
||||
\
|
||||
__typeof (GLRO(dl_vdso_##name)) vdsop = GLRO(dl_vdso_##name); \
|
||||
if (vdsop != NULL) \
|
||||
sc_ret = INTERNAL_VSYSCALL_CALL (vdsop, nr, ##args); \
|
||||
if (sc_ret == -ENOSYS) \
|
||||
sc_ret = INTERNAL_SYSCALL_CALL (name, ##args); \
|
||||
sc_ret; \
|
||||
})
|
||||
|
||||
#endif /* SYSDEP_VDSO_LINUX_H */
|
||||
|
Loading…
Reference in New Issue
Block a user