2020年3月11日 星期三

How to get main() function return value in Linux terminal.

Sometimes we want to get the exit value of main() function, using the "echo $? " can get the most recently program exit value.

Example program:
#include <stdio.h>
int main(void)
{
printf("Hello world\r\n");
return 0xff;
}
view raw gistfile1.txt hosted with ❤ by GitHub



Result:



Reference:
  1. UNIX Shell Programming 

Linux driver: How to enable dynamic debug at booting time for built-in driver.

 Dynamic debug is useful for debug driver, and can be enable by: 1. Mount debug fs #>mount -t debugfs none /sys/kernel/debug 2. Enable dy...