Files
InstanceBrick--nightcap/include/compat/bionic_atfork_runtime.h
T
2026-08-12 20:02:54 +03:00

40 lines
1.4 KiB
C++

// Copyright 2026 Mocktail Project Authors
//
// 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.
#ifndef MOCKTAIL_COMPAT_BIONIC_ATFORK_RUNTIME_H_
#define MOCKTAIL_COMPAT_BIONIC_ATFORK_RUNTIME_H_
namespace mocktail::compat {
using BionicAtForkCallback = void (*)(void);
// POSIX cannot unregister by dso_handle, so registered guest callbacks must
// remain mapped for every later fork.
int RegisterBionicAtFork(BionicAtForkCallback prepare,
BionicAtForkCallback parent,
BionicAtForkCallback child, void* dso_handle) noexcept;
} // namespace mocktail::compat
extern "C" {
int mocktail_bionic_register_atfork(
mocktail::compat::BionicAtForkCallback prepare,
mocktail::compat::BionicAtForkCallback parent,
mocktail::compat::BionicAtForkCallback child, void* dso_handle);
} // extern "C"
#endif // MOCKTAIL_COMPAT_BIONIC_ATFORK_RUNTIME_H_