vfs: check userland buffers before reading them.
[haiku.git] / src / tests / kits / net / sock / global.h
blob1ed2dd4b944cd29316420282753962425dd5151c
1 /* -*- c-basic-offset: 8; -*- */
2 #ifndef GLOBAL_H
3 #define GLOBAL_H
5 #include "config.h" /* configuration options for current OS */
7 #ifdef HAVE_SYS_TYPES_H
8 #include <sys/types.h>
9 #endif
10 #include <errno.h>
11 #include <sys/socket.h>
13 #ifndef HAVE_ADDRINFO_STRUCT
14 #include "addrinfo.h"
15 #endif
17 /* Older resolvers do not have gethostbyname2() */
18 #ifndef HAVE_GETHOSTBYNAME2
19 #define gethostbyname2(host,family) gethostbyname((host))
20 #endif
22 /* This avoids a warning with glibc compilation */
23 #ifndef errno
24 extern int errno;
25 #endif
28 /* Miscellaneous constants */
29 #define MAXLINE 4096 /* max text line length */
30 #define MAXSOCKADDR 128 /* max socket address structure size */
31 #define BUFFSIZE 8192 /* buffer size for reads and writes */
33 /* stdin and stdout file descriptors */
34 #define STDIN_FILENO 0
35 #define STDOUT_FILENO 1
37 #define min(a,b) ((a) < (b) ? (a) : (b))
38 #define max(a,b) ((a) > (b) ? (a) : (b))
41 #endif