I am learning the Android kernel as a newbie. I can read messages thrown from a macro ERROR()inside a function main()in system/core/init/init.cusing the command dmesgvia adb. I noticed that after calling the function open_devnull_stdio()inside main(), it dmesgno longer displays messages sent ERROR().
To find the reason, I started digging into the declaration open_devnull_stdio()inside system/core/init/util.c, and I found this line, which I cannot understand
static const char *name = "/dev/__null__";
Actually, the device did not have a file with a name __null__inside /dev/, but there was a file with a name null, and I was able to capture it with adb pulland it was a 0-byte (empty) file.
So why is the file name wrapped in double underscore (__)?
Here is the link for util.c
source
share