folly/folly/system/AtFork.cpp

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/system/AtFork.h>

#include <stdexcept>
#include <system_error>

#include <folly/ScopeGuard.h>
#include <folly/lang/Exception.h>
#include <folly/portability/PThread.h>
#include <folly/synchronization/SanitizeThread.h>

namespace folly {

void AtForkList::prepare() noexcept {}

void AtForkList::parent() noexcept {}

void AtForkList::child() noexcept {}

void AtForkList::append(
    void const* handle,
    Function<bool()> prepare,
    Function<void()> parent,
    Function<void()> child) {}

void AtForkList::remove(void const* handle) {}

bool AtForkList::contains( //
    void const* handle) {}

namespace {

struct SkipAtForkHandlers {};
thread_local bool SkipAtForkHandlers::value;

void invoke_pthread_atfork(
    void (*prepare)(), void (*parent)(), void (*child)()) {}

struct AtForkListSingleton {};

} // namespace

void AtFork::init() {}

void AtFork::registerHandler(
    void const* handle,
    Function<bool()> prepare,
    Function<void()> parent,
    Function<void()> child) {}

void AtFork::unregisterHandler(void const* handle) {}

pid_t AtFork::forkInstrumented(fork_t forkFn) {}

bool AtFork::init_ =;

} // namespace folly