<p>Symbols like fork are system calls with APIs that are part of POSIX. Access to them are provided by the C library implementations via the <code>unistd.h</code> header.</p>
<p>If you look at the <code>AC_CHECK_DECLS</code> <a href="https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Declarations.html" rel="nofollow noreferrer">documentation</a>, it states that if the includes are not specified, then the <a href="https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Default-Includes.html#Default-Includes" rel="nofollow noreferrer">default includes</a> are used, and this includes <code>unistd.h</code>.</p>

CC BY-SA 4.0
2021-08-14T08:24:50.800Z
I got it, thanks @Andrew
17159
CC BY-SA 4.0
2021-08-13T21:41:17.783Z
2021-08-13T21:41:17.783Z
Ava Chow
<p>I'm a new learner of bitcoin project. I'm aware that the macros in header file config/bitcoin-config.h and whole file itself were generated by autoconf. Looked into configure.ac, regarding to fork symbol, I only see only one check AC_CHECK_DECLS([fork]), i.e., I cannot find where symbol fork is defined, but in bitcoin-config.h value of macro HAVE_DECL_FORK is 1. This is true for some other symbols.
Could anyone help to explain that?</p>
<p><a href="https://github.com/bitcoin/bitcoin/blob/master/configure.ac" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/configure.ac</a></p>

<bitcoin-core><bitcoind>
Macro HAVE_DECL_FORK
17159
# Macro HAVE_DECL_FORK

(Asked by: username_0 on 2021-08-13)

I'm a new learner of bitcoin project. I'm aware that the macros in header file config/bitcoin-config.h and whole file itself were generated by autoconf. Looked into configure.ac, regarding to fork symbol, I only see only one check AC\_CHECK\_DECLS([fork]), i.e., I cannot find where symbol fork is defined, but in bitcoin-config.h value of macro HAVE\_DECL\_FORK is 1. This is true for some other symbols.
Could anyone help to explain that?

<https://github.com/bitcoin/bitcoin/blob/master/configure.ac>

**Tags:** bitcoin-core, bitcoind


---

## 1 answers

### Answer by username_1 on 2021-08-13. Score: 1

Symbols like fork are system calls with APIs that are part of POSIX. Access to them are provided by the C library implementations via the `unistd.h` header.

If you look at the `AC_CHECK_DECLS` [documentation](https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Declarations.html), it states that if the includes are not specified, then the [default includes](https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Default-Includes.html#Default-Includes) are used, and this includes `unistd.h`.

> **Comments:**
> **username_0**: I got it, thanks @Andrew  

---

