nginx-0.0.1-2003-06-11-19:28:34 import
diff --git a/src/os/unix/ngx_aio_read.c b/src/os/unix/ngx_aio_read.c
index 4896af9..bc50558 100644
--- a/src/os/unix/ngx_aio_read.c
+++ b/src/os/unix/ngx_aio_read.c
@@ -1,6 +1,7 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
+#include <ngx_event.h>
 #include <ngx_aio.h>
 
 #if (HAVE_KQUEUE)
diff --git a/src/os/unix/ngx_aio_write.c b/src/os/unix/ngx_aio_write.c
index 918535a..3a4d8e0 100644
--- a/src/os/unix/ngx_aio_write.c
+++ b/src/os/unix/ngx_aio_write.c
@@ -1,6 +1,7 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
+#include <ngx_event.h>
 #include <ngx_aio.h>
 
 #if (HAVE_KQUEUE)
@@ -29,6 +30,7 @@
 ngx_log_debug(ev->log, "aio: ev->ready: %d" _ ev->ready);
 ngx_log_debug(ev->log, "aio: aiocb: %08x" _ &ev->aiocb);
 
+#if 0
     if (ev->timedout) {
         ngx_set_socket_errno(NGX_ETIMEDOUT);
         ngx_log_error(NGX_LOG_ERR, ev->log, 0, "aio_write() timed out");
@@ -46,6 +48,7 @@
 
         ev->ready = 1;
     }
+#endif
 
     first = 0;
 
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h
index 0a7eedd..6fd0a69 100644
--- a/src/os/unix/ngx_freebsd_config.h
+++ b/src/os/unix/ngx_freebsd_config.h
@@ -22,9 +22,22 @@
 #include <osreldate.h>
 
 
-#define  QD_FMT   "%qd"
-#define  QX_FMT   "%qx"
-#define  OFF_FMT  "%qd"
+/* STUB */
+#define  QD_FMT   "%lld"
+#define  QX_FMT   "%llx"
+/**/
+
+#if (i386)
+#define  OFF_FMT    "%lld"
+#define  SIZE_FMT   "%d"
+#define  SIZEX_FMT  "%x"
+#else
+#define  OFF_FMT    "%ld"
+#define  SIZE_FMT   "%ld"
+#define  SIZEX_FMT  "%lx"
+#endif
+
+#define  PID_FMT  "%d"
 
 
 #ifndef HAVE_SELECT
diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c
index a888c36..a3c813e 100644
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -15,7 +15,8 @@
 
    Until FreeBSD 4.5 the turning TCP_NOPUSH off does not not flush
    the pending data that less than MSS and the data sent with 5 second delay.
-   So we use TCP_NOPUSH on FreeBSD 4.5+ only.
+   So we use TCP_NOPUSH on FreeBSD prior to 4.5 only if the connection
+   is not needed not keepalive.
 */
 
 
@@ -23,7 +24,7 @@
 {
     int              rc, eintr, tcp_nopush;
     char            *prev;
-    size_t           hsize, size;
+    ssize_t          hsize, size;
     off_t            sent;
     struct iovec    *iov;
     struct sf_hdtr   hdtr;
diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h
index 96e1d88..27fa317 100644
--- a/src/os/unix/ngx_linux_config.h
+++ b/src/os/unix/ngx_linux_config.h
@@ -29,14 +29,11 @@
 #include <netdb.h>
 
 
-typedef unsigned int    u_int;
-typedef unsigned short  u_short;
-typedef unsigned char   u_char;
 
-
-#define  QD_FMT         "%qd"
-#define  QX_FMT         "%qx"
-#define  OFF_FMT        "%qd"
+#define  QD_FMT   "%qd"
+#define  QX_FMT   "%qx"
+#define  OFF_FMT  "%qd"
+#define  PID_FMT  "%d"
 
 
 #ifndef HAVE_SELECT
@@ -63,7 +60,7 @@
 
 
 #ifndef HAVE_FIONBIO
-#define HAVE_FIONBIO   1         
+#define HAVE_FIONBIO   1
 #endif
 
 
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c
index 8432f0c..744bf99 100644
--- a/src/os/unix/ngx_readv_chain.c
+++ b/src/os/unix/ngx_readv_chain.c
@@ -1,6 +1,7 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
+#include <ngx_event.h>
 
 
 ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry)
diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c
index 98607d0..1545654 100644
--- a/src/os/unix/ngx_recv.c
+++ b/src/os/unix/ngx_recv.c
@@ -1,6 +1,7 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
+#include <ngx_event.h>
 
 
 static int ngx_unix_recv_error(ngx_event_t *rev, ngx_err_t err);
diff --git a/src/os/unix/ngx_socket.c b/src/os/unix/ngx_socket.c
index 941fc8c..48016cb 100644
--- a/src/os/unix/ngx_socket.c
+++ b/src/os/unix/ngx_socket.c
@@ -55,8 +55,7 @@
                       (const void *) &tcp_nopush, sizeof(int));
 }
 
-#else 
-
+#else
 
 int ngx_tcp_nopush(ngx_socket_t s)
 {
diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h
index e794644..78eeb72 100644
--- a/src/os/unix/ngx_solaris_config.h
+++ b/src/os/unix/ngx_solaris_config.h
@@ -30,6 +30,7 @@
 #define  QD_FMT   "%lld"
 #define  QX_FMT   "%llx"
 #define  OFF_FMT  "%lld"
+#define  PID_FMT  "%ld"
 
 
 #ifndef HAVE_SELECT
@@ -62,7 +63,7 @@
 
 
 #ifndef HAVE_FIONBIO
-#define HAVE_FIONBIO   1         
+#define HAVE_FIONBIO   1
 #endif
 
 
diff --git a/src/os/unix/ngx_writev_chain.c b/src/os/unix/ngx_writev_chain.c
index b667bc5..32b2dd4 100644
--- a/src/os/unix/ngx_writev_chain.c
+++ b/src/os/unix/ngx_writev_chain.c
@@ -6,15 +6,14 @@
 ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in)
 {
     char            *prev;
-    size_t           size;
-    ssize_t          n;
+    ssize_t          n, size;
     off_t            sent;
     struct iovec    *iov;
     ngx_err_t        err;
-    ngx_array_t      io;
+    ngx_array_t      iovecs;
     ngx_chain_t     *ce;
 
-    ngx_init_array(io, c->pool, 10, sizeof(struct iovec), NGX_CHAIN_ERROR);
+    ngx_init_array(iovecs, c->pool, 10, sizeof(struct iovec), NGX_CHAIN_ERROR);
 
     prev = NULL;
     iov = NULL;
@@ -27,14 +26,14 @@
             prev = ce->hunk->last;
 
         } else {
-            ngx_test_null(iov, ngx_push_array(&io), NGX_CHAIN_ERROR);
+            ngx_test_null(iov, ngx_push_array(&iovecs), NGX_CHAIN_ERROR);
             iov->iov_base = ce->hunk->pos;
             iov->iov_len = ce->hunk->last - ce->hunk->pos;
             prev = ce->hunk->last;
         }
     }
 
-    n = writev(c->fd, (struct iovec *) io.elts, io.nelts);
+    n = writev(c->fd, iovecs.elts, iovecs.nelts);
 
     if (n == -1) {
         err = ngx_errno;
@@ -93,7 +92,7 @@
         break;
     }
 
-    ngx_destroy_array(&io);
+    ngx_destroy_array(&iovecs);
 
     return ce;
 }