httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Reid" <ab...@dial.pipex.com>
Subject {PATCH} ap_put_statinfo
Date Tue, 02 Nov 1999 22:23:21 GMT
Whilst looking into the ap_mmap stuff it seemed like a good idea to add the
following function.  Rather than just committing I'm flagging it here as it
might not be portable etc etc

Anyway, I'll commit it later this week unless there's a reason not to.

For an idea of where this might be useful can I point you at default_handler
in http_core.c for the mmap sections.

david

--- /boot/home/cvs/apache-2.0/src/lib/apr/include/apr_file_io.h Sat Oct 16
12:46:13 1999
+++ include/apr_file_io.h Tue Nov  2 21:27:27 1999
@@ -58,6 +58,7 @@

 #include "apr_general.h"
 #include "apr_errno.h"
+#include <sys/stat.h>
 #ifdef HAVE_TIME_H
 #include <time.h>
 #endif
@@ -162,6 +163,8 @@
 ap_status_t ap_get_fileatime(time_t *, ap_file_t *);
 ap_status_t ap_get_filectime(time_t *, ap_file_t *);
 ap_status_t ap_get_filemtime(time_t *, ap_file_t *);
+
+ap_status_t ap_put_statinfo(ap_file_t *, struct stat *);

 #ifdef __cplusplus
 }
diff -ru /boot/home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c
unix/filestat.c
--- /boot/home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c Tue Oct  5
02:15:19 1999
+++ unix/filestat.c Tue Nov  2 21:27:14 1999
@@ -84,3 +84,19 @@
     }
 }

+ap_status_t ap_put_statinfo(struct file_t *thefile, struct stat *theinfo)
+{
+    if (thefile == NULL)
+        return APR_EBADF;
+
+    thefile->protection = theinfo->st_mode;
+    thefile->user = theinfo->st_uid;
+    thefile->group = theinfo->st_gid;
+    thefile->size = theinfo->st_size;
+    thefile->atime = theinfo->st_atime;
+    thefile->mtime = theinfo->st_mtime;
+    thefile->ctime = theinfo->st_ctime;
+    thefile->stated = 1;
+    return APR_SUCCESS;
+}
+



Mime
View raw message