0

I'd love to do a proper shutdown of the Pi from a program (written in C) so that the only thing left to do is pull the power plug. Is this possible?

3
  • 4
    Yes. What have you tried? – joan Jan 15 at 11:24
  • your question is about linux, not about RPi – jsotola Jan 16 at 0:05
  • I didn't even know where to start. – user120300 Jan 19 at 5:33
4

Call system():

#include <stdlib.h>
  ...
  system("sudo shutdown now");
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.