You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/06/12 23:47:20 UTC
cvs commit: apache-2.0/src/support logresolve.c rotatelogs.c
rbb 00/06/12 14:47:18
Modified: . STATUS
src/include ap_config.h
src/main http_connection.c http_core.c http_protocol.c
http_vhost.c util.c util_uri.c
src/modules/mpm/dexter dexter.c
src/modules/mpm/mpmt_pthread mpmt_pthread.c
src/modules/mpm/prefork prefork.c
src/modules/standard mod_access.c mod_auth_db.c
mod_auth_dbm.c mod_cgid.c mod_log_config.c
mod_mime_magic.c mod_rewrite.c mod_rewrite.h
mod_unique_id.c mod_vhost_alias.c
src/os/unix unixd.c
src/support logresolve.c rotatelogs.c
Log:
Clean up a big chunk of ap_config.h. This basically stops ap_config.h from
including any files. Because of this change, other files must include
their own headers. I also cleaned up a couple of other bugs in some
modules because I had to compile them all.
I expect this to break multiple platforms, but this will be fixed over time.
The massive configure cleanup is almost done. I will go through the files
one more time after this commit.
Revision Changes Path
1.91 +1 -5 apache-2.0/STATUS
Index: STATUS
===================================================================
RCS file: /home/cvs/apache-2.0/STATUS,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- STATUS 2000/06/12 17:28:48 1.90
+++ STATUS 2000/06/12 21:46:35 1.91
@@ -1,5 +1,5 @@
Apache 2.0 STATUS:
-Last modified at [$Date: 2000/06/12 17:28:48 $]
+Last modified at [$Date: 2000/06/12 21:46:35 $]
Release:
@@ -30,10 +30,6 @@
libraries/flags on the different platforms (current, we default
to -ldl which is wrong).
Status:
-
- - reduce number of configuration items, which in turn reduces the
- amount of stuff in ap_config_auto.h.in
- Status: Ryan +1 (working on it), Greg +1
* suEXEC doesn't work
Status: Manoj has posted an patch to fix this.
1.35 +9 -77 apache-2.0/src/include/ap_config.h
Index: ap_config.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/ap_config.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- ap_config.h 2000/06/12 15:28:49 1.34
+++ ap_config.h 2000/06/12 21:46:35 1.35
@@ -104,48 +104,6 @@
#include <string.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-/* The next three are for inet_*() */
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_PWD_H /* XXX - For getpw*. This should be moved to unixd */
-#include <pwd.h>
-#endif
-
-#ifdef HAVE_GRP_H /* XXX - For getgr*. This should be moved to unixd */
-#include <grp.h>
-#endif
-
/* ap_ versions of ctype macros to make sure they deal with 8-bit chars */
#include "ap_ctype.h"
@@ -166,29 +124,6 @@
#define ap_sigwait(a,b) sigwait((a),(b))
#endif
-/* So that we can use inline on some critical functions, and use
- * GNUC attributes (such as to get -Wall warnings for printf-like
- * functions). Only do this in gcc 2.7 or later ... it may work
- * on earlier stuff, but why chance it.
- *
- * We've since discovered that the gcc shipped with NeXT systems
- * as "cc" is completely broken. It claims to be __GNUC__ and so
- * on, but it doesn't implement half of the things that __GNUC__
- * means. In particular it's missing inline and the __attribute__
- * stuff. So we hack around it. PR#1613. -djg
- */
-#if !defined(__GNUC__) || __GNUC__ < 2 || \
- (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
- defined(NEXT)
-#define ap_inline
-#define __attribute__(__x)
-#define ENUM_BITFIELD(e,n,w) signed int n : w
-#else
-#define ap_inline __inline__
-#define USE_GNU_INLINE
-#define ENUM_BITFIELD(e,n,w) e n : w
-#endif
-
/* EAGAIN apparently isn't defined on some systems */
#if !defined(HAVE_EAGAIN) && !defined(EAGAIN)
#define EAGAIN EWOULDBLOCK
@@ -216,19 +151,10 @@
#endif
#ifdef SCO5
-/* XXX - What's this for */
-#define SecureWare
-
-/* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
- consts. Sigh. */
-extern int strcasecmp(const char *, const char *);
-extern int strncasecmp(const char *, const char *, unsigned);
-#endif /* SCO5 */
-
-/* If APR has OTHER_CHILD logic, use reliable piped logs.
+/* This allows Apache to run from a startup script on a SCO box in high
+ * security (C2) mode.
*/
-#if (APR_HAS_OTHER_CHILD)
-#define HAVE_RELIABLE_PIPED_LOGS TRUE
+#define SecureWare
#endif
/* XXX - The PHP4 comments say -D_HPUX_SOURCE is obsolete. */
@@ -249,6 +175,12 @@
#define USE_FILE_BASED_SCOREBOARD
#else
#define USE_MEM_BASED_SCOREBOARD
+#endif
+
+/* If APR has OTHER_CHILD logic, use reliable piped logs.
+ */
+#if (APR_HAS_OTHER_CHILD)
+#define HAVE_RELIABLE_PIPED_LOGS TRUE
#endif
#if defined(CHARSET_EBCDIC) && !defined(APACHE_XLATE)
1.37 +3 -0 apache-2.0/src/main/http_connection.c
Index: http_connection.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_connection.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- http_connection.c 2000/05/27 22:53:48 1.36
+++ http_connection.c 2000/06/12 21:46:36 1.37
@@ -67,6 +67,9 @@
#include "http_config.h"
#include "http_vhost.h"
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
AP_HOOK_STRUCT(
AP_HOOK_LINK(pre_connection)
AP_HOOK_LINK(process_connection)
1.71 +1 -0 apache-2.0/src/main/http_core.c
Index: http_core.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- http_core.c 2000/06/06 21:45:11 1.70
+++ http_core.c 2000/06/12 21:46:36 1.71
@@ -73,6 +73,7 @@
#include "http_connection.h"
#include "util_ebcdic.h"
#include "mpm.h"
+#include <netdb.h>
/* Allow Apache to use ap_mmap */
#ifdef USE_MMAP_FILES
1.78 +1 -0 apache-2.0/src/main/http_protocol.c
Index: http_protocol.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- http_protocol.c 2000/06/05 02:26:52 1.77
+++ http_protocol.c 2000/06/12 21:46:36 1.78
@@ -78,6 +78,7 @@
#include "util_charset.h"
#include "mpm_status.h"
#include <stdarg.h>
+#include <unistd.h>
AP_HOOK_STRUCT(
AP_HOOK_LINK(post_read_request)
1.18 +4 -0 apache-2.0/src/main/http_vhost.c
Index: http_vhost.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_vhost.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- http_vhost.c 2000/04/14 15:58:56 1.17
+++ http_vhost.c 2000/06/12 21:46:36 1.18
@@ -70,6 +70,10 @@
#include "http_protocol.h"
#include "http_core.h"
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
/*
* After all the definitions there's an explanation of how it's all put
* together.
1.51 +11 -5 apache-2.0/src/main/util.c
Index: util.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/util.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- util.c 2000/06/12 15:28:53 1.50
+++ util.c 2000/06/12 21:46:36 1.51
@@ -80,12 +80,18 @@
#include "http_config.h"
#include "util_ebcdic.h"
-#if defined(SUNOS4)
-/* stdio.h has been read in ap_config.h already. Add missing prototypes here: */
-extern int fgetc(FILE *);
-extern char *fgets(char *s, int, FILE*);
-extern int fclose(FILE *);
+#include <stdio.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#ifdef HAVE_PWD_H
+#include <pwd.h>
#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
/* A bunch of functions in util.c scan strings looking for certain characters.
* To make that more efficient we encode a lookup table. The test_char_table
1.11 +1 -0 apache-2.0/src/main/util_uri.c
Index: util_uri.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/util_uri.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- util_uri.c 2000/05/28 03:52:42 1.10
+++ util_uri.c 2000/06/12 21:46:37 1.11
@@ -66,6 +66,7 @@
#include "http_log.h"
#include "util_uri.h"
#include <string.h>
+#include <netdb.h>
/* Some WWW schemes and their default ports; this is basically /etc/services */
/* This will become global when the protocol abstraction comes */
1.94 +2 -0 apache-2.0/src/modules/mpm/dexter/dexter.c
Index: dexter.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- dexter.c 2000/06/12 18:07:33 1.93
+++ dexter.c 2000/06/12 21:46:46 1.94
@@ -76,7 +76,9 @@
#include "mpm.h"
#include "scoreboard.h"
+#include <unistd.h>
#include <poll.h>
+#include <sys/socket.h>
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
1.87 +1 -0 apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
Index: mpmt_pthread.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- mpmt_pthread.c 2000/06/12 18:07:37 1.86
+++ mpmt_pthread.c 2000/06/12 21:46:49 1.87
@@ -78,6 +78,7 @@
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
+#include <sys/socket.h>
#include <sys/wait.h>
#include <pthread.h>
#include <signal.h>
1.100 +2 -0 apache-2.0/src/modules/mpm/prefork/prefork.c
Index: prefork.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/mpm/prefork/prefork.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- prefork.c 2000/06/12 15:29:00 1.99
+++ prefork.c 2000/06/12 21:46:54 1.100
@@ -108,6 +108,8 @@
#include <sys/times.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/socket.h>
+#include <unistd.h>
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h> /* for TCP_NODELAY */
1.13 +8 -0 apache-2.0/src/modules/standard/mod_access.c
Index: mod_access.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_access.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- mod_access.c 2000/05/27 22:40:34 1.12
+++ mod_access.c 2000/06/12 21:46:56 1.13
@@ -73,6 +73,14 @@
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
enum allowdeny_type {
T_ENV,
1.14 +4 -3 apache-2.0/src/modules/standard/mod_auth_db.c
Index: mod_auth_db.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_auth_db.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- mod_auth_db.c 2000/06/09 18:57:14 1.13
+++ mod_auth_db.c 2000/06/12 21:46:58 1.14
@@ -99,6 +99,7 @@
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
+#include "http_request.h" /* for ap_hook_(check_user_id | auth_check) */
#ifdef HAVE_DB_H
#include <db.h>
#endif
@@ -319,10 +320,10 @@
invalid_pw = ap_validate_password(sent_pw, real_pw);
if (invalid_pw != APR_SUCCESS) {
- char buf[120]
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
- "DB user %s: authentication failure for \"%s\": %s",
- r->user, r->uri, ap_strerror(invalid_pw, buf, sizeof(buf)));
+ "DB user %s: authentication failure for \"%s\": "
+ "Password Mismatch",
+ r->user, r->uri);
ap_note_basic_auth_failure(r);
return AUTH_REQUIRED;
}
1.13 +4 -2 apache-2.0/src/modules/standard/mod_auth_dbm.c
Index: mod_auth_dbm.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_auth_dbm.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- mod_auth_dbm.c 2000/04/26 07:14:37 1.12
+++ mod_auth_dbm.c 2000/06/12 21:46:59 1.13
@@ -75,6 +75,7 @@
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
+#include "http_request.h" /* for ap_hook_(check_user_id | auth_checker)*/
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) \
&& __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
#include <db1/ndbm.h>
@@ -239,8 +240,9 @@
invalid_pw = ap_validate_password(sent_pw, real_pw);
if (invalid_pw != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
- "DBM user %s: authentication failure for \"%s\": %s",
- r->user, r->uri, invalid_pw);
+ "DBM user %s: authentication failure for \"%s\": "
+ "Password Mismatch",
+ r->user, r->uri);
ap_note_basic_auth_failure(r);
return AUTH_REQUIRED;
}
1.20 +2 -0 apache-2.0/src/modules/standard/mod_cgid.c
Index: mod_cgid.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cgid.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- mod_cgid.c 2000/06/12 20:42:11 1.19
+++ mod_cgid.c 2000/06/12 21:47:00 1.20
@@ -90,6 +90,8 @@
#include "ap_mpm.h"
#include "iol_socket.h"
#include "unixd.h"
+#include <sys/stat.h>
+#include <sys/socket.h> /* for sockaddr_un */
#include <sys/un.h> /* for sockaddr_un */
#include <sys/types.h>
#include <sys/stat.h>
1.24 +1 -0 apache-2.0/src/modules/standard/mod_log_config.c
Index: mod_log_config.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_log_config.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- mod_log_config.c 2000/05/27 22:40:37 1.23
+++ mod_log_config.c 2000/06/12 21:47:00 1.24
@@ -176,6 +176,7 @@
#include "http_core.h" /* For REMOTE_NAME */
#include "http_log.h"
#include "http_protocol.h"
+#include <unistd.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
1.21 +4 -4 apache-2.0/src/modules/standard/mod_mime_magic.c
Index: mod_mime_magic.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_mime_magic.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- mod_mime_magic.c 2000/05/22 17:05:23 1.20
+++ mod_mime_magic.c 2000/06/12 21:47:01 1.21
@@ -132,6 +132,8 @@
#include "http_log.h"
#include "http_protocol.h"
#include "util_script.h"
+#include <sys/stat.h>
+#include <unistd.h>
#ifdef HAVE_UTIME_H
#include <utime.h>
#endif
@@ -2155,7 +2157,6 @@
ap_pool_t *child_context = cntxt;
ap_procattr_t *procattr;
ap_proc_t *procnew = NULL;
- ap_file_t *file = NULL;
ap_iol *iol;
env = ap_create_environment(child_context, r->subprocess_env);
@@ -2179,7 +2180,7 @@
close(STDERR_FILENO);
}
- rc = ap_create_process(&procnew, compr[parm->method].argv[0],
+ rc = ap_create_process(procnew, compr[parm->method].argv[0],
new_argv, env, procattr, child_context);
if (rc != APR_SUCCESS) {
@@ -2191,8 +2192,7 @@
else {
ap_note_subprocess(child_context, procnew, kill_after_timeout);
/* Fill in BUFF structure for parents pipe to child's stdout */
- ap_get_childout(&file, procnew);
- iol = ap_create_file_iol(file);
+ iol = ap_create_file_iol(procnew->out);
if (!iol)
return APR_EBADF;
if (script_in) {
1.31 +9 -0 apache-2.0/src/modules/standard/mod_rewrite.c
Index: mod_rewrite.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_rewrite.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- mod_rewrite.c 2000/06/12 18:43:41 1.30
+++ mod_rewrite.c 2000/06/12 21:47:02 1.31
@@ -111,6 +111,15 @@
#include <sys/uio.h>
#endif
#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
/*
** +-------------------------------------------------------+
1.12 +1 -1 apache-2.0/src/modules/standard/mod_rewrite.h
Index: mod_rewrite.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_rewrite.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mod_rewrite.h 2000/06/12 15:43:10 1.11
+++ mod_rewrite.h 2000/06/12 21:47:04 1.12
@@ -450,7 +450,7 @@
static char *subst_prefix_path(request_rec *r, char *input, char *match,
char *subst);
static int parseargline(char *str, char **a1, char **a2, char **a3);
-static int prefix_stat(const char *path, struct stat *sb);
+static int prefix_stat(const char *path, ap_finfo_t *sb);
static void add_env_variable(request_rec *r, char *s);
/* Lexicographic Comparison */
1.15 +6 -0 apache-2.0/src/modules/standard/mod_unique_id.c
Index: mod_unique_id.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_unique_id.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- mod_unique_id.c 2000/06/08 02:56:27 1.14
+++ mod_unique_id.c 2000/06/12 21:47:04 1.15
@@ -66,6 +66,12 @@
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
+#include "http_protocol.h" /* for ap_hook_post_read_request */
+
+#include <netdb.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
typedef struct {
unsigned int stamp;
1.10 +2 -0 apache-2.0/src/modules/standard/mod_vhost_alias.c
Index: mod_vhost_alias.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_vhost_alias.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mod_vhost_alias.c 2000/05/27 22:40:38 1.9
+++ mod_vhost_alias.c 2000/06/12 21:47:05 1.10
@@ -75,9 +75,11 @@
* both written by James Grinter <jr...@blodwen.demon.co.uk>.
*/
+#include "ap_hooks.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
+#include "http_request.h" /* for ap_hook_translate_name */
module MODULE_VAR_EXPORT vhost_alias_module;
1.16 +2 -0 apache-2.0/src/os/unix/unixd.c
Index: unixd.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/os/unix/unixd.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- unixd.c 2000/06/09 18:57:16 1.15
+++ unixd.c 2000/06/12 21:47:14 1.16
@@ -65,6 +65,8 @@
#include <pwd.h>
#include <sys/resource.h>
#include <sys/resource.h>
+#include <unistd.h>
+#include <grp.h>
unixd_config_rec unixd_config;
1.7 +1 -0 apache-2.0/src/support/logresolve.c
Index: logresolve.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/support/logresolve.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- logresolve.c 2000/04/27 04:22:57 1.6
+++ logresolve.c 2000/06/12 21:47:15 1.7
@@ -42,6 +42,7 @@
#include "ap_config.h"
#include <ctype.h>
#include <stdio.h>
+#include <netdb.h>
#if !defined(MPE) && !defined(BEOS) && !defined(WIN32)
#include <arpa/inet.h>
1.8 +1 -0 apache-2.0/src/support/rotatelogs.c
Index: rotatelogs.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/support/rotatelogs.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- rotatelogs.c 2000/05/19 23:23:13 1.7
+++ rotatelogs.c 2000/06/12 21:47:17 1.8
@@ -67,6 +67,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#define BUFSIZE 65536