diff options
author | midipix <writeonce@midipix.org> | 2018-06-29 01:00:36 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-06-29 01:37:44 -0400 |
commit | 9706faf3b18a3fe231bff70e6d8acd62aaae99df (patch) | |
tree | 4bd85493b914dd8565c36776ec85814009c7532b /src/internal/slibtool_driver_impl.h | |
parent | c178e3616873d4bb6d94d6fb68633497a4df0ef5 (diff) | |
download | slibtool-9706faf3b18a3fe231bff70e6d8acd62aaae99df.tar.bz2 slibtool-9706faf3b18a3fe231bff70e6d8acd62aaae99df.tar.xz |
execution context: generated wrapper: replaced the stream with a pure fd.
Diffstat (limited to 'src/internal/slibtool_driver_impl.h')
-rw-r--r-- | src/internal/slibtool_driver_impl.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h index 47c854e..2eb7a14 100644 --- a/src/internal/slibtool_driver_impl.h +++ b/src/internal/slibtool_driver_impl.h @@ -99,6 +99,17 @@ struct slbt_driver_ctx_impl { struct slbt_error_info erribuf[64]; }; +struct slbt_exec_ctx_impl { + int argc; + char * args; + char * shadow; + char * dsoprefix; + size_t size; + struct slbt_exec_ctx ctx; + int fdwrapper; + char * vbuffer[]; +}; + static inline struct slbt_driver_ctx_impl * slbt_get_driver_ictx(const struct slbt_driver_ctx * dctx) { uintptr_t addr; @@ -139,4 +150,34 @@ static inline int slbt_driver_fdlog(const struct slbt_driver_ctx * dctx) return fdctx.fdlog; } +static inline struct slbt_exec_ctx_impl * slbt_get_exec_ictx(const struct slbt_exec_ctx * ectx) +{ + uintptr_t addr; + + addr = (uintptr_t)ectx - offsetof(struct slbt_exec_ctx_impl,ctx); + return (struct slbt_exec_ctx_impl *)addr; +} + +static inline int slbt_exec_get_fdwrapper(const struct slbt_exec_ctx * ectx) +{ + struct slbt_exec_ctx_impl * ictx; + ictx = slbt_get_exec_ictx(ectx); + return ictx->fdwrapper; +} + +static inline void slbt_exec_set_fdwrapper(const struct slbt_exec_ctx * ectx, int fd) +{ + struct slbt_exec_ctx_impl * ictx; + ictx = slbt_get_exec_ictx(ectx); + ictx->fdwrapper = fd; +} + +static inline void slbt_exec_close_fdwrapper(const struct slbt_exec_ctx * ectx) +{ + struct slbt_exec_ctx_impl * ictx; + ictx = slbt_get_exec_ictx(ectx); + close(ictx->fdwrapper); + ictx->fdwrapper = (-1); +} + #endif |