MySQL 8.4.2
Source Code Documentation
my_io_bits.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, Oracle and/or its affiliates.
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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef COMPONENTS_SERVICES_BITS_MY_IO_BITS_H
25#define COMPONENTS_SERVICES_BITS_MY_IO_BITS_H
26
27/**
28 @file mysql/components/services/bits/my_io_bits.h
29 Types to make file and socket I/O compatible.
30*/
31
32#if defined(_WIN32) && !defined(MYSQL_ABI_CHECK)
33/* Include common headers.*/
34#include <io.h> /* access(), chmod() */
35#ifdef WIN32_LEAN_AND_MEAN
36#include <winsock2.h>
37#include <ws2tcpip.h> /* SOCKET */
38#endif
39#endif
40
41#ifndef MYSQL_ABI_CHECK
42#if !defined(_WIN32)
43#include <sys/socket.h>
44#include <unistd.h>
45#endif
46#include <errno.h>
47#include <limits.h>
48#include <sys/types.h> // Needed for mode_t, so IWYU pragma: keep.
49#endif
50
51typedef int File; /* File descriptor */
52#if defined(_WIN32) && !defined(MYSQL_ABI_CHECK)
53typedef int MY_MODE;
54typedef int mode_t;
55typedef int socket_len_t;
56typedef SOCKET my_socket;
57#define MY_SOCKET_FMT "%llu"
58#else
59typedef mode_t MY_MODE;
60typedef socklen_t socket_len_t;
61typedef int my_socket; /* File descriptor for sockets */
62#define MY_SOCKET_FMT "%d"
63#endif /* _WIN32 */
64
65#endif /* COMPONENTS_SERVICES_BITS_MY_IO_BITS_H */
mode_t MY_MODE
Definition: my_io_bits.h:59
int File
Definition: my_io_bits.h:51
int my_socket
Definition: my_io_bits.h:61
socklen_t socket_len_t
Definition: my_io_bits.h:60