diff options
author | midipix <writeonce@midipix.org> | 2017-02-11 14:38:50 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2017-02-11 19:23:15 -0500 |
commit | c70c0a72abe470aa16aefd47f1fdde5c4aa0718f (patch) | |
tree | 0cc0fe527b27e7d5f074f792eeeb5ad270af2d86 /src/helper | |
parent | 9c013b63fef168f49246fd69ab0c0ce024a20941 (diff) | |
download | mdso-c70c0a72abe470aa16aefd47f1fdde5c4aa0718f.tar.bz2 mdso-c70c0a72abe470aa16aefd47f1fdde5c4aa0718f.tar.xz |
driver: utility api: added mdso_create_implib_archive().
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/mdso_create_output.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/helper/mdso_create_output.c b/src/helper/mdso_create_output.c index b152697..5f4a761 100644 --- a/src/helper/mdso_create_output.c +++ b/src/helper/mdso_create_output.c @@ -17,7 +17,8 @@ static FILE * mdso_create_output( const struct mdso_driver_ctx * dctx, - const char * name) + const char * name, + int fdat) { struct mdso_driver_ctx_impl * ictx; uintptr_t addr; @@ -26,8 +27,9 @@ static FILE * mdso_create_output( addr = (uintptr_t)dctx - offsetof(struct mdso_driver_ctx_impl,ctx); ictx = (struct mdso_driver_ctx_impl *)addr; + fdat = (fdat == AT_FDCWD) ? AT_FDCWD : ictx->fddst; - if ((fdout = openat(ictx->fddst,name, + if ((fdout = openat(fdat,name, O_CREAT|O_TRUNC|O_WRONLY|O_NOCTTY|O_NOFOLLOW, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) { MDSO_SYSTEM_ERROR(dctx); @@ -43,6 +45,13 @@ static FILE * mdso_create_output( return fout; } +FILE * mdso_create_archive( + const struct mdso_driver_ctx * dctx, + const char * arname) +{ + return mdso_create_output(dctx,arname,AT_FDCWD); +} + FILE * mdso_create_asm_source( const struct mdso_driver_ctx * dctx, const char * asmname) @@ -50,7 +59,7 @@ FILE * mdso_create_asm_source( if (!dctx->cctx->dstdir) return stdout; - return mdso_create_output(dctx,asmname); + return mdso_create_output(dctx,asmname,-1); } FILE * mdso_create_object( @@ -62,5 +71,5 @@ FILE * mdso_create_object( return 0; } - return mdso_create_output(dctx,objname); + return mdso_create_output(dctx,objname,-1); } |