Click here to Skip to main content
15,065,324 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is my script file


echo +10 > /sys/class/rtc/rtc0/wakealarm

cat <<-EOF
Invoke suspend sequence
Command: echo mem > /sys/power/state
Waking up in about 10 seconds ...
EOF
sleep 1
echo mem > /sys/power/state

What I have tried:

I want to convert it into cpp code, i need help to change the script into code in all possible methods...
Posted
Updated 22-Jun-21 23:00pm

1 solution

This is your fourth question on this exact problem and you have been given all the available suggestions. It is now time to start putting all the information together. And as you should be aware, system commands do not always have a direct C/C++ function that can be used. Specific details of each command, and links to callable functions, can be found in the man pages.

[edit]
See also Ubuntu Manpage: syscalls - Linux system calls[^].
[/edit]
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900