rbb 99/10/12 13:00:33
Modified: src/lib/apr/file_io/unix fileio.h readwrite.c
src/lib/apr/include apr_file_io.h
Log:
Add a function to allow people to actually create and use ap_iovec_t's.
I knew I needed this, but kept forgetting to add it.
Revision Changes Path
1.3 +1 -1 apache-2.0/src/lib/apr/file_io/unix/fileio.h
Index: fileio.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/fileio.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- fileio.h 1999/10/04 16:36:50 1.2
+++ fileio.h 1999/10/12 20:00:30 1.3
@@ -96,7 +96,7 @@
struct iovec_t {
ap_context_t *cntxt;
- struct iovec *iovec;
+ struct iovec *theiov;
};
ap_status_t file_cleanup(void *);
1.11 +12 -1 apache-2.0/src/lib/apr/file_io/unix/readwrite.c
Index: readwrite.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- readwrite.c 1999/10/06 23:03:47 1.10
+++ readwrite.c 1999/10/12 20:00:31 1.11
@@ -149,10 +149,21 @@
* written on function exit.
*/
#ifdef HAVE_WRITEV
+
+ap_status_t ap_make_iov(struct iovec_t **new, struct iovec *iova,
ap_context_t *cntxt)
+{
+ (*new) = ap_palloc(cntxt, sizeof(struct iovec_t));
+ if ((*new) == NULL) {
+ return APR_ENOMEM;
+ }
+ (*new)->cntxt = cntxt;
+ (*new)->theiov = iova;
+}
+
ap_status_t ap_writev(struct file_t *thefile, const struct iovec_t *vec,
ap_ssize_t *iocnt)
{
int bytes;
- if ((bytes = writev(thefile->filedes, vec->iovec, *iocnt)) < 0) {
+ if ((bytes = writev(thefile->filedes, vec->theiov, *iocnt)) < 0) {
*iocnt = bytes;
return errno;
}
1.12 +1 -0 apache-2.0/src/lib/apr/include/apr_file_io.h
Index: apr_file_io.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_file_io.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- apr_file_io.h 1999/10/11 14:20:38 1.11
+++ apr_file_io.h 1999/10/12 20:00:33 1.12
@@ -125,6 +125,7 @@
API_EXPORT(int) ap_fprintf(ap_file_t *fptr, const char *format, ...)
__attribute__((format(printf,2,3)));
+ap_status_t ap_make_iov(struct iovec_t **, struct iovec *, ap_context_t *);
ap_status_t ap_dupfile(ap_file_t **, ap_file_t *);
ap_status_t ap_getfileinfo(ap_file_t *);
ap_status_t ap_seek(ap_file_t *, ap_seek_where_t, ap_off_t *);