MySQL 8.0.40
Source Code Documentation
mysql_socket_bits.h
Go to the documentation of this file.
1#ifndef COMPONENTS_SERVICES_BITS_MYSQL_SOCKET_BITS_H
2#define COMPONENTS_SERVICES_BITS_MYSQL_SOCKET_BITS_H
3
4/* Copyright (c) 2010, 2024, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License, version 2.0,
8 as published by the Free Software Foundation.
9
10 This program is designed to work with certain software (including
11 but not limited to OpenSSL) that is licensed under separate terms,
12 as designated in a particular file or component or in included license
13 documentation. The authors of MySQL hereby grant you an additional
14 permission to link the program and your derivative works with the
15 separately licensed software that they have either included with
16 the program or referenced in the documentation.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License, version 2.0, for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26*/
27
28#include "my_io.h"
30
31/**
32 An instrumented socket.
33 @c MYSQL_SOCKET is a replacement for @c my_socket.
34*/
36 /** The real socket descriptor. */
38
39 /**
40 The instrumentation hook.
41 Note that this hook is not conditionally defined,
42 for binary compatibility of the @c MYSQL_SOCKET interface.
43 */
45};
46
47/**
48 @def MYSQL_INVALID_SOCKET
49 MYSQL_SOCKET initial value.
50*/
51// MYSQL_SOCKET MYSQL_INVALID_SOCKET= {INVALID_SOCKET, NULL};
52#define MYSQL_INVALID_SOCKET mysql_socket_invalid()
53
54/**
55 MYSQL_SOCKET helper. Initialize instrumented socket.
56 @sa mysql_socket_getfd
57 @sa mysql_socket_setfd
58*/
60 MYSQL_SOCKET mysql_socket = {INVALID_SOCKET, nullptr};
61 return mysql_socket;
62}
63
64#endif // COMPONENTS_SERVICES_BITS_MYSQL_SOCKET_BITS_H
Common #defines and includes for file and socket I/O.
#define INVALID_SOCKET
Definition: my_io.h:190
Types to make file and socket I/O compatible.
int my_socket
Definition: mysql.h:65
static MYSQL_SOCKET mysql_socket_invalid()
MYSQL_SOCKET helper.
Definition: mysql_socket_bits.h:59
An instrumented socket.
Definition: mysql_socket_bits.h:35
struct PSI_socket * m_psi
The instrumentation hook.
Definition: mysql_socket_bits.h:44
my_socket fd
The real socket descriptor.
Definition: mysql_socket_bits.h:37
Interface for an instrumented socket descriptor.
Definition: psi_socket_bits.h:69