MySQL 8.4.2
Source Code Documentation
|
#include "sql-common/net_ns.h"
#include <assert.h>
#include <sched.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <map>
#include <mutex>
#include <unordered_map>
#include "my_sys.h"
#include "mysql/components/services/log_builtins.h"
#include "mysqld_error.h"
Macros | |
#define | _GNU_SOURCE |
Typedefs | |
using | namespaces_registry_t = std::map< std::string, int > |
Functions | |
static bool | open_network_namespace (const std::string &network_namespace, int *fd) |
Open a network namespace specified by function argument. More... | |
static bool | save_original_network_namespace (int *orig_ns_fd) |
Remember a file descriptor corresponding to the current active network namespace. More... | |
bool | set_network_namespace (const std::string &network_namespace) |
Set active network namespace specified by a name. More... | |
bool | restore_original_network_namespace () |
Restore original network namespace used to be active before a new network namespace has been set. More... | |
void | release_network_namespace_resources () |
Close file descriptors for every opened network namespace file and release a memory used by internal cache of opened network namespaces. More... | |
Variables | |
static namespaces_registry_t | opened_namespaces |
static std::mutex | lock |
static int | original_ns_fd = -1 |
#define _GNU_SOURCE |
using namespaces_registry_t = std::map<std::string, int> |
|
static |
Open a network namespace specified by function argument.
network_namespace | a name of the network namespace to open | |
[out] | fd | file descriptor corresponding to the opened network namespace |
void release_network_namespace_resources | ( | ) |
Close file descriptors for every opened network namespace file and release a memory used by internal cache of opened network namespaces.
bool restore_original_network_namespace | ( | ) |
Restore original network namespace used to be active before a new network namespace has been set.
|
static |
Remember a file descriptor corresponding to the current active network namespace.
[out] | orig_ns_fd | file descriptor corresponding to a network namespace used to be active before |
bool set_network_namespace | ( | const std::string & | network_namespace | ) |
Set active network namespace specified by a name.
network_namespace | the name of a network namespace to be set active |
|
static |
|
static |
|
static |