2026-10-16 17:16 UTC
Advanced Programming in the #UNIX Environment
Week 5: Program Startup
How does a program start? "Uhm... you write 'main()' and that's it!" Not so fast! The C startup routine needs to set up the environment and moves arguments etc. into the right registers for main to be called, which then returns an int to be passed to exit(3), so use your debugger to better understand how the process begins and ends its life, often more like
_start() -> ___start() -> exit(main(...))
https://youtu.be/Yul4d-BDdx8
Replies (1)
-
@jschauma@mstdn.social 2026-10-18 20:15
Advanced Programming in the #UNIX Environment Week 5: Program Termination Having observed how a process starts, let's now look at how programs terminate. We observe the return status and how exit handlers are registered, yielding a more complete picture of a unix process's lifetime. https://youtu.be/xNeEw1f_js8