3 Copyright (C) Andrew Tridgell 1999
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #define _XOPEN_SOURCE 500
32 #include <sys/types.h>
33 #include <sys/socket.h>
41 #include <netinet/in.h>
42 #include <netinet/tcp.h>
46 #define MSG_WAITALL 0x100
51 #define MIN(x,y) ((x)<(y)?(x):(y))
54 #define TCP_OPTIONS "TCP_NODELAY SO_REUSEADDR"
59 #define uint32 unsigned
67 double bytes_in, bytes_out;
71 /* CreateDisposition field. */
72 #define FILE_SUPERSEDE 0
75 #define FILE_OPEN_IF 3
76 #define FILE_OVERWRITE 4
77 #define FILE_OVERWRITE_IF 5
79 /* CreateOptions field. */
80 #define FILE_DIRECTORY_FILE 0x0001
81 #define FILE_WRITE_THROUGH 0x0002
82 #define FILE_SEQUENTIAL_ONLY 0x0004
83 #define FILE_NON_DIRECTORY_FILE 0x0040
84 #define FILE_NO_EA_KNOWLEDGE 0x0200
85 #define FILE_EIGHT_DOT_THREE_ONLY 0x0400
86 #define FILE_RANDOM_ACCESS 0x0800
87 #define FILE_DELETE_ON_CLOSE 0x1000
90 #define O_DIRECTORY 0200000