Chris Nauroth created ZOOKEEPER-4654:
----------------------------------------

             Summary: C client test compilation error in Util.cc.
                 Key: ZOOKEEPER-4654
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4654
             Project: ZooKeeper
          Issue Type: Bug
          Components: c client
            Reporter: Chris Nauroth
            Assignee: Chris Nauroth


{{Util.cc}} has started to fail in compilation due to undeclared symbol 
{{nanosleep}}:

{code}
     [exec] 
/usr/local/google/home/cnauroth/zookeeper/apache-zookeeper-3.6.4/zookeeper-client/zookeeper-client-c/tests/Util.cc:
 In function ‘void millisleep(int)’:
     [exec] 
/usr/local/google/home/cnauroth/zookeeper/apache-zookeeper-3.6.4/zookeeper-client/zookeeper-client-c/tests/Util.cc:32:5:
 error: ‘nanosleep’ was not declared in this scope
     [exec]    32 |     nanosleep(&ts,0);
     [exec]       |     ^~~~~~~~~
     [exec] make[1]: *** [Makefile:1580: zktest_st-Util.o] Error 1
     [exec] make: *** [Makefile:2143: check-am] Error 2
{code}

As per the 
[nanosleep(2)|https://man7.org/linux/man-pages/man2/nanosleep.2.html] man page, 
this is declared in time.h. We can fix this by including the header.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to