openmrn icon indicating copy to clipboard operation
openmrn copied to clipboard

usleep is deprecated in posix API

Open balazsracz opened this issue 6 years ago • 1 comments

wen have a bunch of usleep calls and with a recent compiler they cannot be compiled anymore unless we do #define _DEFAULT_SOURCE. The appropriate posix header does not export the function.

We need to review all call sites for usleep, and do one of the following:

  • move the calls to .cxx and add _DEFAULT_SOURCE there
  • or export the prototype to usleep ourselves (we already have an implementation for MCUs i believe).

balazsracz avatar Mar 02 '19 16:03 balazsracz

POSIX.1-2001 declares this function obsolete; use nanosleep(2) instead. POSIX.1-2008 removes the specification of usleep().

We should consider implementing (where required) and using nanosleep instead.

bakerstu avatar Mar 02 '19 17:03 bakerstu