analogdevicesinc / libad9361-iio

IIO AD9361 library for filter design and handling, multi-chip sync, etc.
http://analogdevicesinc.github.io/libad9361-iio/
GNU Lesser General Public License v2.1
73 stars 49 forks source link

usleep implicit declaration in ad9361_multichip_sync.c #20

Closed adwaitnd closed 5 years ago

adwaitnd commented 5 years ago

https://github.com/analogdevicesinc/libad9361-iio/blob/8052086ffc8137d68b64eab4d1bc8d26f62ce869/ad9361_multichip_sync.c#L96

usleep(1000) gives an implicit declaration warning while compiling on Ubuntu 18.04 and Rasbian stretch (raspberry pi). This also results in the library not being able to communicate with the PlutoSDR. Replacing it with sleep(1) solves the problem.

rgetz commented 5 years ago

usleep is in the man pages:

http://manpages.ubuntu.com/manpages/bionic/man3/usleep.3.html

isn't it defined in your ? We include that....

However - usleep() has been removed since POSIX-2008 and I think we should be using nanosleep() instead ...

http://manpages.ubuntu.com/manpages/bionic/en/man3/nanosleep.3posix.html

-Robin

adwaitnd commented 5 years ago

usleep doesn't seem to be in Ubuntu 18.04's usr/include/linux/unistd.h. It's defined in usr/include/unistd.h as an extern function but does not have an implementation anywhere.

commodo commented 5 years ago

Shoudl be fixed via PR #21 Feel free to re-open if still an issue :)

Thanks for reporting