[dbench @ cvs-1:tridge-20041120165230-79uzz0dny3yyd5vd]
[tridge/dbench.git] / dbench.h
1 /* 
2    dbench version 2
3    Copyright (C) Andrew Tridgell 1999
4    
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.
9    
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.
14    
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.
18 */
19
20 #define _XOPEN_SOURCE 500
21
22 #include <stdlib.h>
23 #include <signal.h>
24 #include <unistd.h>
25 #include <stdio.h>
26 #include <string.h>
27 #include <ctype.h>
28 #include <dirent.h>
29 #include <sys/stat.h>
30 #include <sys/time.h>
31 #include <sys/wait.h>
32 #include <sys/types.h>
33 #include <sys/socket.h>
34 #include <fcntl.h>
35 #include <sys/ipc.h>
36 #include <sys/shm.h>
37 #include <sys/mman.h>
38 #include <errno.h>
39 #include <strings.h>
40 #include <stdint.h>
41 #include <netinet/in.h>
42 #include <netinet/tcp.h>
43 #include <netdb.h>
44
45 #ifndef MSG_WAITALL
46 #define MSG_WAITALL 0x100
47 #endif
48
49 #define PRINT_FREQ 1
50
51 #define MIN(x,y) ((x)<(y)?(x):(y))
52
53 #define TCP_PORT 7003
54 #define TCP_OPTIONS "TCP_NODELAY SO_REUSEADDR"
55
56 #define BOOL int
57 #define True 1
58 #define False 0
59 #define uint32 unsigned
60
61 struct child_struct {
62         int id;
63         int nprocs;
64         int status;
65         int line;
66         int done;
67         double bytes_in, bytes_out;
68 };
69
70
71 /* CreateDisposition field. */
72 #define FILE_SUPERSEDE 0
73 #define FILE_OPEN 1
74 #define FILE_CREATE 2
75 #define FILE_OPEN_IF 3
76 #define FILE_OVERWRITE 4
77 #define FILE_OVERWRITE_IF 5
78
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
88
89 #ifndef O_DIRECTORY
90 #define O_DIRECTORY    0200000
91 #endif
92
93 #include "proto.h"
94