]> git.saurik.com Git - apple/libc.git/blame - sys/_libc_fork_child.c
Libc-1439.100.3.tar.gz
[apple/libc.git] / sys / _libc_fork_child.c
CommitLineData
8e029c65 1/*
1f2f436a 2 * Copyright (c) 2010 Apple Inc. All rights reserved.
8e029c65
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
8e029c65 23/*
1f2f436a 24 * _libc_fork_child() is called from Libsystem's libSystem_atfork_child()
8e029c65 25 */
6465356a 26#include <TargetConditionals.h>
507116e3 27#if __has_include(<CrashReporterClient.h>)
23e20b00 28#include <CrashReporterClient.h>
507116e3
A
29#else
30#define CRSetCrashLogMessage(...)
31#endif
8e029c65 32
70ad1dc8
A
33#pragma clang diagnostic push
34#pragma clang diagnostic ignored "-Wstrict-prototypes"
35
1f2f436a 36extern void _arc4_fork_child();
6465356a 37extern void _init_clock_port(void);
974e3884 38extern void __environ_lock_fork_child();
34e8f829 39
6465356a 40void _libc_fork_child(void); // todo: private_extern?
1f2f436a
A
41void
42_libc_fork_child(void)
43{
6465356a
A
44 CRSetCrashLogMessage("crashed on child side of fork pre-exec");
45
1f2f436a
A
46 _arc4_fork_child();
47 _init_clock_port();
974e3884 48 __environ_lock_fork_child();
1f2f436a 49}
70ad1dc8 50#pragma clang diagnostic pop