logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0002-Make-tcp_sysent-a-static-inline-function.patch (1042B)


  1. From 75a23af067ff5390a47df1e877f68834241009b9 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 6 Jul 2019 01:40:36 -0700
  4. Subject: [PATCH] Make tcp_sysent a static inline function
  5. This way we can include the second operand to the conditional
  6. operator without evaluating the macro argument multiple times.
  7. ---
  8. src/defs.h | 8 ++++++--
  9. 1 file changed, 6 insertions(+), 2 deletions(-)
  10. diff --git a/src/defs.h b/src/defs.h
  11. index ae1d1d1dc..bbd8f6748 100644
  12. --- a/src/defs.h
  13. +++ b/src/defs.h
  14. @@ -402,8 +402,12 @@ struct tcb {
  15. # define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL)
  16. # define has_seccomp_filter(tcp) ((tcp)->flags & TCB_SECCOMP_FILTER)
  17. -extern const struct_sysent stub_sysent;
  18. -# define tcp_sysent(tcp) (tcp->s_ent ?: &stub_sysent)
  19. +static inline const struct_sysent *
  20. +tcp_sysent(struct tcb *tcp)
  21. +{
  22. + extern const struct_sysent stub_sysent;
  23. + return tcp->s_ent ? tcp->s_ent : &stub_sysent;
  24. +}
  25. # define n_args(tcp) (tcp_sysent(tcp)->nargs)
  26. # include "xlat.h"
  27. --
  28. 2.44.0