Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 27718 invoked by uid 6000); 2 Nov 1999 22:24:01 -0000 Received: (qmail 27705 invoked from network); 2 Nov 1999 22:23:58 -0000 Received: from server1.jetnet.co.uk (194.73.252.30) by taz.hyperreal.org with SMTP; 2 Nov 1999 22:23:58 -0000 Received: from godzilla (godzilla.jetnet.co.uk [192.168.26.10]) by server1.jetnet.co.uk (8.9.3/8.9.3) with SMTP id WAA65345 for ; Tue, 2 Nov 1999 22:23:00 GMT Message-ID: <001d01bf2580$e4022290$0a1aa8c0@jetnet.co.uk> From: "David Reid" To: Subject: {PATCH} ap_put_statinfo Date: Tue, 2 Nov 1999 22:23:21 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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 #ifdef HAVE_TIME_H #include #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; +} +