Skip to content

Commit 73bd131

Browse files
committed
pthread_at_fork: bogus implementation
Because we do not support fork, there is no need to do anything upon fork (and if it changes in the future, we should revisit this) So we can get away with this simple implementation that just returns 0. Signed-off-by: Glauber Costa <[email protected]>
1 parent f36d39a commit 73bd131

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

libc/pthread.cc

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,25 @@ int pthread_key_create(pthread_key_t* key, void (*dtor)(void*))
180180
return 0;
181181
}
182182

183-
extern "C"
184-
int __pthread_key_create(pthread_key_t* key, void (*dtor)(void*))
185-
__attribute__((alias("pthread_key_create")));
183+
int pthread_atfork(void (*prepare)(void), void (*parent)(void),
184+
void (*child)(void))
185+
{
186+
return 0;
187+
}
188+
189+
extern "C" int register_atfork(void (*prepare)(void), void (*parent)(void),
190+
void (*child)(void), void *__dso_handle)
191+
{
192+
return 0;
193+
}
194+
195+
extern "C" {
196+
int __register_atfork(void (*prepare)(void), void (*parent)(void),
197+
void (*child)(void), void *__dso_handle) __attribute__((alias("register_atfork")));
198+
int __pthread_key_create(pthread_key_t* key, void (*dtor)(void*))
199+
__attribute__((alias("pthread_key_create")));
200+
}
201+
186202

187203
int pthread_key_delete(pthread_key_t key)
188204
{

0 commit comments

Comments
 (0)