123456789101112131415161718192021222324252627282930313233343536373839 |
- #include <stdlib.h>
- #include <stdio.h>
- int
- main(int argc, char* argv[])
- {
- char* stmt = "loginctl suspend";
- FILE* p;
- p = popen(stmt, "r");
- if (p == NULL) {
- printf("Error: `loginctl` not found.\n");
- printf("You must have loginctl installed (see elogind) in order to suspend your machine in a modern way\n");
- return 1;
- }
- pclose(p);
- return 0;
- }
|