From ec000532ee50c64e66a76114b745f6804901bab9 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 5 Aug 2018 04:29:18 -0400 Subject: driver, library interfaces: support alternate fd's for input/output/error/log. --- include/ntux/ntux.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include/ntux') diff --git a/include/ntux/ntux.h b/include/ntux/ntux.h index 07c735b..d43e8ad 100644 --- a/include/ntux/ntux.h +++ b/include/ntux/ntux.h @@ -64,6 +64,15 @@ struct ntux_source_version { const char * commit; }; +struct ntux_fd_ctx { + int fdin; + int fdout; + int fderr; + int fdlog; + int fdcwd; + int fddst; +}; + struct ntux_error_info { const struct ntux_driver_ctx * edctx; const struct ntux_unit_ctx * euctx; @@ -107,17 +116,21 @@ struct ntux_unit_ctx { /* driver api */ ntux_api int ntux_get_driver_ctx (char **, char **, uint32_t, + const struct ntux_fd_ctx *, struct ntux_driver_ctx **); ntux_api void ntux_free_driver_ctx (struct ntux_driver_ctx *); +ntux_api int ntux_get_driver_fdctx (const struct ntux_driver_ctx *, struct ntux_fd_ctx *); +ntux_api int ntux_set_driver_fdctx (struct ntux_driver_ctx *, const struct ntux_fd_ctx *); + /* cmd api */ ntux_api int ntux_cmd_stat (const struct ntux_driver_ctx *, const char *); ntux_api int ntux_cmd_spawn (const struct ntux_driver_ctx *); ntux_api int ntux_cmd_strace (const struct ntux_driver_ctx *); /* utility api */ -ntux_api int ntux_main (int, char **, char **); +ntux_api int ntux_main (int, char **, char **, const struct ntux_fd_ctx *); /* error trace api */ ntux_api int ntux_output_error_vector (const struct ntux_driver_ctx *); -- cgit v1.2.3