Anonymous
oh
labyrinth
ok thank you
labyrinth
Anonymous
oh
labyrinth
then is there a way to verify that the program did run successfully? for zombie process, there are macros functions that can check with the status code returned by wait_pid. how about just a hello world process that could finish in 1ms?
labyrinth
i think the interview question was geared to linux command rather than coding though
labyrinth
ahh thank you very much
Anonymous
Guys, why do function has always to return something? And, is it the only difference between procedures and function?
Anonymous
Guys, why do function has always to return something? And, is it the only difference between procedures and function?
I mean, what is the benefit of doing a typical "int main ()" and doing a "int main (void)"? Procedure = int main (void)
Anonymous
But why do the os need it?
Tute
But why do the os need it?
to let it know that your program finish sucssefuly, or inform the user something wrong happend
Anonymous
to let it know that your program finish sucssefuly, or inform the user something wrong happend
So, introducing a (void) won't tell you that the program finished succesfully?
Alex
But why do the os need it?
for example for writing scripts: you call program and depending on the exit status continue script or exit with error message
Tute
So, introducing a (void) won't tell you that the program finished succesfully?
main always return an int (in C++ it's mandatory), in C if you use void main your program will always return 0 to your OS
Tute
Ooooo.... What if you return 1? or any number?
nothing, but your OS will complain that something wrong happend with the program...
Anonymous
nothing, but your OS will complain that something wrong happend with the program...
... Is there a list of errors that os give depending on the return value? Does it depend on the os? Or the compiler?
Tute
... Is there a list of errors that os give depending on the return value? Does it depend on the os? Or the compiler?
for example, if you could not open a file you return 2, but if you couldn't open a socket you return 1, to know what happend (it's for developers only, user just see an error prompt if you choose to show it)
labyrinth
Can anyone recommend a group about computer network?
Anonymous
on my pc all daemons have systemd as parent though
Anonymous
oh some actually have a user owned systemd, which is a child of the root owned systemd, as the parent. it seems like it isn't about old and new, just who needs what access.
Anonymous
oh by "some old daemons" you meant "some old init daemons"
Anonymous
i thought you were talking about daemons spawned by init and by old daemons (non init) you meant daemons which have not been updated in a while.
Anonymous
😅
Tokin
Slackware for life..
Tokin
Jk windows for life
Tokin
Heh
Tokin
Although the day I actually begin to read and understand the Windows Internals book.. Will be the day it will make a difference I guess
Arminio
heh :)
ZX
Hey guys how are you doing? I am looking for some C and C++ books is there a chance to find them here?
Tokin
Yes use the bot mate
ZX
thank you
Tokin
Forgot the command
Tokin
http://www.iso-9899.info/wiki/Books
ZX
Thank you very much!
Tokin
Go child! Design a kernel and thank me ;)
ZX
=)
ZX
Thank you guys!
Anonymous
#best-book
@unchanted
How to setup visual studio IDE for win32 API in c/c++ ?
Anonymous
How to setup visual studio IDE for win32 API in c/c++ ?
Is there anything to setup? WinApi is built-in
@unchanted
It is showing error
Anonymous
What error?
Anonymous
No screen photos here
@unchanted
Oh ok
Anonymous
There's no main function in your project
Anonymous
It's not a WinApi or anything issue
Anonymous
ye but he just wanted a hello world program with parent 1. just making a systemd service out of an executable should be enough for that, no?
Anonymous
arch
@unchanted
There's no main function in your project
Should i leave main function empty?
Anonymous
Anonymous
Should i leave main function empty?
How do you think your program is going to be executed without a main function?
@unchanted
You should define it
Wow bro it worked
Anonymous
oh. ye i see now
@unchanted
How do you think your program is going to be executed without a main function?
Yeah in some of the tutorials they didn't used main function...
@unchanted
How do you think your program is going to be executed without a main function?
It Build properly but it is not running (Not showing any message box)
@unchanted
Wat?
Yes according to the code i was expecting a message box
@unchanted
My code is also correct
Anonymous
Yes according to the code i was expecting a message box
1) I don't see your code 2) if your main function function us empty there's nothing going to happen
Anonymous
My code is also correct
No, it's not
@unchanted
No, it's not
WinMain is a function so should i call that function in int main?
Anonymous
Why not to just use simple main?
Anonymous
Why are you using WinApi in first place actually?
@unchanted
Why not to just use simple main?
Don't we use WinMain for win32 api?
Anonymous
Don't we use WinMain for win32 api?
I don't think it's necessary
Anonymous
Fortunately I'm not a WinApi expert
@unchanted
Why not to just use simple main?
Simple main will be under DOS I used winmain for windows gui