在 2023/12/8 21:59, Florian Weimer via Gcc 写道:
   [PATCH] libgcov: Call __builtin_fork instead of fork
   
<https://inbox.sourceware.org/gcc-patches/87edg4epw5....@oldenburg.str.redhat.com/>

May I ask why it's not something like this?

Even though there may be people who define `fork()` in global scope, it will be semantically different from the POSIX fork.


```
diff --git a/libgcc/libgcov-interface.c b/libgcc/libgcov-interface.c
index b2ee9308641..10ce8edc4fb 100644
--- a/libgcc/libgcov-interface.c
+++ b/libgcc/libgcov-interface.c
@@ -174,7 +174,7 @@ __gcov_dump (void)

 #endif /* L_gcov_dump */

-#ifdef L_gcov_fork
+#if defined L_gcov_fork && !defined _WIN32
 /* A wrapper for the fork function.  We reset counters in the child
    so that they are not counted twice.  */

```


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to