set-process-query-on-exit-flag

set-process-query-on-exit-flag is a built-in function in `C source code'.

(set-process-query-on-exit-flag PROCESS FLAG)

Specify if query is needed for PROCESS when Emacs is exited.
If the second argument FLAG is non-nil, Emacs will query the user before
exiting or killing a buffer if PROCESS is running. This function
returns FLAG.