diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c index b145130bc7..e599986e10 100644 --- a/lib/isc/unix/file.c +++ b/lib/isc/unix/file.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: file.c,v 1.36 2001/07/10 04:23:01 bwelling Exp $ */ +/* $Id: file.c,v 1.37 2001/07/16 17:26:44 gson Exp $ */ #include @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -290,3 +291,15 @@ isc_file_progname(const char *filename, char *buf, size_t buflen) { return (ISC_R_SUCCESS); } + +isc_result_t +isc_file_absolutepath(const char *filename, char *path, size_t pathlen) { + isc_result_t result; + result = isc_dir_current(path, pathlen, ISC_TRUE); + if (result != ISC_R_SUCCESS) + return (result); + if (strlen(path) + strlen(filename) + 1 > pathlen) + return (ISC_R_NOSPACE); + strcat(path, filename); + return (ISC_R_SUCCESS); +}