Re: What does kernel do when it receives the SIGKILL



Binary wrote:
Hi,

As I know, SIGKILL is performed by linux kernel that kill the app, what
I want to know is if the app is terminated, the opened file will be
closed by kernel?

If that were not the case, there would be a resource leak every time a
process was killed.

A file being open means that there is a file descriptor object in
memory which is associated with that file. To close a file essentially
means to discard that file descriptor object.

If a file is deleted while one or more descriptors reference it, it
continues to exist until the last close, even though no directory entry
references it. So if process termination failed to close files, not
only would it result in a resource leak in memory, it would also cause
resource leaks on disk, which would only be hunted down at the next
file system check (fsck).

.



Relevant Pages

  • Service starts interactive application
    ... I've made a NT service which can launch interactive apps on selectable ... finally launches the app on that desktop. ... terminated it sends WM_Close to the app, waits for its termination, ... removes the ACEs from Winsta0 and Default and terminates itself. ...
    (microsoft.public.win32.programmer.ui)
  • Re: catch the process terminate from the task manager
    ... aha well you can`t catch the termination of your app when it is killed ... as the app is forcefully killed (equivalant as your app is ended with the ... if you End Process in the Processes tab of Task Manager. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How do I stop this thing?
    ... In most real-world scenerios your applications should be prepared for graceful terminations, if possible, in all situations. ... other words, you want your app to have a chance to save settings, perform proper clean-up, etc. before exiting. ... I don't believe that Application.Exitis an immediate termination, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: New user question
    ... mainis a c/c++ function. ... and no other function in that app can be named main. ... you to the non-architecture specific Linux kernel. ... essence, the main function for the Linux kernel. ...
    (alt.os.linux)
  • Re: What does kernel do when it receives the SIGKILL
    ... As I know, SIGKILL is performed by linux kernel that kill the app, what ...
    (comp.os.linux.development.system)

Loading