rbb 99/04/22 12:20:59
Modified: docs fileio.txt include apr_file_io.h apr/file_io/unix filedup.c Log: A new file function to allow me to specify a file descriptor to be put into an apr_file. I am still trying to figure out if this needs to be abstracted more, and how to do it. But, the function is needed for the process stuff, so I am committing it now. Revision Changes Path 1.16 +7 -0 apache-apr/docs/fileio.txt Index: fileio.txt =================================================================== RCS file: /home/cvs/apache-apr/docs/fileio.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- fileio.txt 1999/04/20 20:52:53 1.15 +++ fileio.txt 1999/04/22 19:20:55 1.16 @@ -189,6 +189,13 @@ NOTE: If directory name is NULL, the platform decides where it is best to put the pipe. To get it in the current dir, use "." here :) +apr_status_t apr_pushfile(apr_file_t *, int) + Push a platform specific file descriptor into the apr file type. + Arguments: + arg 1) the file descriptor to modify. + arg 2) The file descriptor to push. + return) APR_SUCCESS or APR_FAILURE + **************** IMPLEMENTATION DETAILS ************** struct apr_file_t { 1.17 +1 -0 apache-apr/include/apr_file_io.h Index: apr_file_io.h =================================================================== RCS file: /home/cvs/apache-apr/include/apr_file_io.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- apr_file_io.h 1999/04/20 20:46:42 1.16 +++ apr_file_io.h 1999/04/22 19:20:56 1.17 @@ -115,6 +115,7 @@ apr_ssize_t apr_writev(apr_file_t *, const apr_iovec_t *, apr_ssize_t); apr_file_t *apr_dupfile(apr_file_t *); +apr_status_t apr_pushfile(apr_file_t *, int); apr_status_t apr_getfileinfo(char *, apr_file_t *); apr_status_t apr_updatefileinfo(apr_file_t *); apr_off_t apr_seek(apr_file_t *, apr_off_t, apr_seek_where_t); 1.4 +8 -0 apache-apr/apr/file_io/unix/filedup.c Index: filedup.c =================================================================== RCS file: /home/cvs/apache-apr/apr/file_io/unix/filedup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- filedup.c 1999/04/12 15:25:52 1.3 +++ filedup.c 1999/04/22 19:20:58 1.4 @@ -76,3 +76,11 @@ old_file->ctime = new_file->ctime; } +apr_status_t apr_pushfile(apr_file_t *oldfile, int fd) +{ + if (dup2(oldfile->filedes, fd) == -1) + return APR_FAILURE; + return APR_SUCCESS; +} + +