Bug 362033

Summary: undeclared identifier build failures for getpid(), usleep(), and getuid()
Product: [Unmaintained] valkyrie Reporter: ilovezfs
Component: generalAssignee: Cerion Armour-Brown <cerion>
Status: RESOLVED UNMAINTAINED    
Severity: normal    
Priority: NOR    
Version: 2.0.0   
Target Milestone: ---   
Platform: Other   
OS: macOS   
URL: https://github.com/Homebrew/homebrew-core/pull/502
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description ilovezfs 2016-04-21 12:33:22 UTC
All of the following is resolved by including unistd.h in src/utils/vk_utils.h (though there may be other possible solutions):

```
compiling moc/moc_opt_le_widget.cpp
compiling moc/moc_mainwindow.cpp
utils/vk_utils.cpp:54:76: error: use of undeclared identifier 'getpid'
   fprintf( stdout, "===%s:%d=== ", qPrintable( VkCfg::appName() ), ( int )getpid() );
                                                                           ^
utils/vk_utils.cpp:68:76: error: use of undeclared identifier 'getpid'
   fprintf( stderr, "===%s:%d=== ", qPrintable( VkCfg::appName() ), ( int )getpid() );
                                                                           ^
utils/vk_utils.cpp:83:76: error: use of undeclared identifier 'getpid'
   fprintf( stderr, "===%s:%d=== ", qPrintable( VkCfg::appName() ), ( int )getpid() );
                                                                           ^
3 errors generated.
make[1]: *** [obj/vk_utils.o] Error 1
make[1]: *** Waiting for unfinished jobs....
objects/tool_object.cpp:391:7: error: use of undeclared identifier 'usleep'
      usleep( WAIT_VG_START_SLEEP * 1000 );
      ^
objects/tool_object.cpp:474:13: error: use of undeclared identifier 'usleep'
            usleep( 1000 * sleepDuration );
            ^
utils/vk_config.cpp:125:18: error: use of undeclared identifier 'getuid'
      pid_t me = getuid();
                 ^
2 errors generated.
make[1]: *** [obj/tool_object.o] Error 1
1 error generated.
make[1]: *** [obj/vk_config.o] Error 1
make: *** [sub-src-install_subtargets] Error 2
/usr/local/Library/Homebrew/debrew.rb:11:in `raise'
BuildError: Failed executing: make install
```

Reproducible: Always

Steps to Reproduce:
1. try to build on OS X 10.11 El Capitan (possibly lower too)
2.
3.

Actual Results:  
build fails

Expected Results:  
build succeeds

+    inreplace "src/utils/vk_utils.h", "#include <iostream>",
+                                      "#include <iostream>\n#include <unistd.h>"

patches the problem.
Comment 1 Andrew Crouthamel 2018-09-04 16:05:40 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug.