diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-31 16:08:09 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-31 16:08:09 +0300 |
commit | ea901526648c43ef8e961b3d7e051b9ca14b65ca (patch) | |
tree | cea5a96dc83518a94f79dddd645f3e4404179530 /src/apk_io.h | |
parent | 67108bf07a67811ea91fc965f3f1592a4a70044e (diff) | |
download | apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.tar.gz apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.tar.bz2 apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.tar.xz apk-tools-ea901526648c43ef8e961b3d7e051b9ca14b65ca.zip |
apk: use *at instead of chdir+normal file syscall
this way we never change cwd, and relative filenames are always
parsed consistently. this also helps filename construction in many
places. this patch also changes '--root' to override location of
all configuration to be in the new root. previously it depended
on the file which one was used.
Diffstat (limited to 'src/apk_io.h')
-rw-r--r-- | src/apk_io.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/apk_io.h b/src/apk_io.h index b76385c..759bec4 100644 --- a/src/apk_io.h +++ b/src/apk_io.h @@ -66,8 +66,8 @@ struct apk_ostream *apk_ostream_gzip(struct apk_ostream *); struct apk_ostream *apk_ostream_counter(off_t *); struct apk_istream *apk_istream_from_fd(int fd); -struct apk_istream *apk_istream_from_file(const char *file); -struct apk_istream *apk_istream_from_file_gz(const char *file); +struct apk_istream *apk_istream_from_file(int atfd, const char *file); +struct apk_istream *apk_istream_from_file_gz(int atfd, const char *file); struct apk_istream *apk_istream_from_url(const char *url); struct apk_istream *apk_istream_from_url_gz(const char *url); size_t apk_istream_skip(struct apk_istream *istream, size_t size); @@ -76,20 +76,21 @@ size_t apk_istream_splice(void *stream, int fd, size_t size, struct apk_bstream *apk_bstream_from_istream(struct apk_istream *istream); struct apk_bstream *apk_bstream_from_fd(int fd); -struct apk_bstream *apk_bstream_from_file(const char *file); +struct apk_bstream *apk_bstream_from_file(int atfd, const char *file); struct apk_bstream *apk_bstream_from_url(const char *url); -struct apk_bstream *apk_bstream_tee(struct apk_bstream *from, const char *to); +struct apk_bstream *apk_bstream_tee(struct apk_bstream *from, int atfd, const char *to); struct apk_ostream *apk_ostream_to_fd(int fd); -struct apk_ostream *apk_ostream_to_file(const char *file, mode_t mode); -struct apk_ostream *apk_ostream_to_file_gz(const char *file, mode_t mode); +struct apk_ostream *apk_ostream_to_file(int atfd, const char *file, mode_t mode); +struct apk_ostream *apk_ostream_to_file_gz(int atfd, const char *file, mode_t mode); size_t apk_ostream_write_string(struct apk_ostream *ostream, const char *string); apk_blob_t apk_blob_from_istream(struct apk_istream *istream, size_t size); -apk_blob_t apk_blob_from_file(const char *file); +apk_blob_t apk_blob_from_file(int atfd, const char *file); -int apk_file_get_info(const char *filename, int checksum, struct apk_file_info *fi); -int apk_url_download(const char *url, const char *file); +int apk_file_get_info(int atfd, const char *filename, int checksum, + struct apk_file_info *fi); +int apk_url_download(const char *url, int atfd, const char *file); const char *apk_url_local_file(const char *url); #endif |