MySQL  8.0.18
Source Code Documentation
my_io_bits.h
Go to the documentation of this file.
1 /* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef COMPONENTS_SERVICES_MY_IO_BITS_H
24 #define COMPONENTS_SERVICES_MY_IO_BITS_H
25 
26 /**
27  @file mysql/components/services/my_io_bits.h
28  Types to make file and socket I/O compatible.
29 */
30 
31 #ifdef _WIN32
32 /* Include common headers.*/
33 #include <io.h> /* access(), chmod() */
34 #ifdef WIN32_LEAN_AND_MEAN
35 #include <winsock2.h>
36 #include <ws2tcpip.h> /* SOCKET */
37 #endif
38 #endif
39 
40 #ifndef MYSQL_ABI_CHECK
41 #if !defined(_WIN32)
42 #include <sys/socket.h>
43 #include <unistd.h>
44 #endif
45 #include <errno.h>
46 #include <limits.h>
47 #include <sys/types.h> // Needed for mode_t, so IWYU pragma: keep.
48 #endif
49 
50 typedef int File; /* File descriptor */
51 #ifdef _WIN32
52 typedef int MY_MODE;
53 typedef int mode_t;
54 typedef int socket_len_t;
55 typedef SOCKET my_socket;
56 #else
57 typedef mode_t MY_MODE;
58 typedef socklen_t socket_len_t;
59 typedef int my_socket; /* File descriptor for sockets */
60 #endif /* _WIN32 */
61 
62 #endif /* COMPONENTS_SERVICES_MY_IO_BITS_H */
#define SOCKET
Definition: config_static.h:17
socklen_t socket_len_t
Definition: my_io_bits.h:58
int my_socket
Definition: my_io_bits.h:59
int File
Definition: my_io_bits.h:50
mode_t MY_MODE
Definition: my_io_bits.h:57