Usually a running programme has a means to permanently return control to the system that started it--"terminate" or "exit". Often, there is a way to set a small integer for the system's benefit while leaving (For example, in java: System.exit(37); ) A system user, or agent, could then use this to better understand why the programme was written to terminate.