Fix build on FreeBSD (#12714)

Summary:
The error message is as follows:
```
port/stack_trace.cc:286:7: error: use of undeclared identifier 'waitpid'
      waitpid(child_pid, &wstatus, 0);
      ^
port/stack_trace.cc:287:11: error: use of undeclared identifier 'WIFEXITED'
      if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) == EXIT_SUCCESS) {
          ^
port/stack_trace.cc:287:33: error: use of undeclared identifier 'WEXITSTATUS'
      if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) == EXIT_SUCCESS) {
                                ^
3 errors generated.
```

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12714

Reviewed By: ajkr

Differential Revision: D57970244

Pulled By: jaykorean

fbshipit-source-id: afdad9af16b4bfe5e059bc82180f74b2c3260ed9
This commit is contained in:
Po-Chuan Hsieh 2024-05-30 17:48:17 -07:00 committed by Facebook GitHub Bot
parent 8a462eefae
commit 76aa0d9ee2
1 changed files with 1 additions and 0 deletions

View File

@ -39,6 +39,7 @@ void* SaveStack(int* /*num_frames*/, int /*first_frames_to_skip*/) {
#endif // OS_OPENBSD #endif // OS_OPENBSD
#ifdef OS_FREEBSD #ifdef OS_FREEBSD
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/wait.h>
#endif // OS_FREEBSD #endif // OS_FREEBSD
#ifdef OS_LINUX #ifdef OS_LINUX
#include <sys/prctl.h> #include <sys/prctl.h>