Browse Source

AP_HAL_Linux: do not attempt to run examples realtime unless root

mission-4.1.18
Peter Barker 8 years ago committed by Lucas De Marchi
parent
commit
220a3d19bf
  1. 7
      libraries/AP_HAL_Linux/Scheduler.cpp

7
libraries/AP_HAL_Linux/Scheduler.cpp

@ -63,6 +63,13 @@ void Scheduler::init_realtime() @@ -63,6 +63,13 @@ void Scheduler::init_realtime()
// we don't run Replay in real-time...
return;
#endif
#if APM_BUILD_TYPE(APM_BUILD_UNKNOWN)
// we opportunistically run examples/tools in realtime
if (geteuid() != 0) {
printf("WARNING: not running as root. Will not use realtime scheduling\n");
return;
}
#endif
mlockall(MCL_CURRENT|MCL_FUTURE);

Loading…
Cancel
Save