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 3 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, see <http://www.gnu.org/licenses/>.
31 #include <sys/types.h>
32 #include <sys/socket.h>
43 #ifdef HAVE_SYS_STATVFS_H
44 #include <sys/statvfs.h>
47 #include <sys/param.h>
48 #ifdef HAVE_SYS_MOUNT_H
49 #include <sys/mount.h>
57 #include <netinet/in.h>
58 #include <netinet/tcp.h>
62 #include <attr/xattr.h>
63 #elif HAVE_SYS_XATTR_H
64 #include <sys/xattr.h>
65 #elif HAVE_SYS_ATTRIBUTES_H
66 #include <sys/attributes.h>
69 #ifdef HAVE_SYS_EXTATTR_H
70 #include <sys/extattr.h>
78 #define MSG_WAITALL 0x100
84 #define MIN(x,y) ((x)<(y)?(x):(y))
88 #define TCP_OPTIONS "TCP_NODELAY SO_REUSEADDR"
93 #define uint32 unsigned
101 struct child_struct {
107 int cleanup_finished;
108 const char *directory;
110 double bytes_done_warmup;
112 double worst_latency;
113 struct timeval starttime;
114 struct timeval lasttime;
115 off_t bytes_since_fsync;
119 struct timeval last_time;
122 struct op op_NTCreateX;
126 struct op op_Deltree;
129 struct op op_Qpathinfo;
130 struct op op_Qfileinfo;
131 struct op op_Qfsinfo;
132 struct op op_Sfileinfo;
137 struct op op_UnlockX;
153 const char *directory;
158 int clients_per_process;
159 int one_byte_write_fix;
165 /* CreateDisposition field. */
166 #define FILE_SUPERSEDE 0
168 #define FILE_CREATE 2
169 #define FILE_OPEN_IF 3
170 #define FILE_OVERWRITE 4
171 #define FILE_OVERWRITE_IF 5
173 /* CreateOptions field. */
174 #define FILE_DIRECTORY_FILE 0x0001
175 #define FILE_WRITE_THROUGH 0x0002
176 #define FILE_SEQUENTIAL_ONLY 0x0004
177 #define FILE_NON_DIRECTORY_FILE 0x0040
178 #define FILE_NO_EA_KNOWLEDGE 0x0200
179 #define FILE_EIGHT_DOT_THREE_ONLY 0x0400
180 #define FILE_RANDOM_ACCESS 0x0800
181 #define FILE_DELETE_ON_CLOSE 0x1000
184 #define O_DIRECTORY 0200000
189 extern struct options options;