EXIT(3R)

NAME
exit - cease execution

SYNOPSIS
void exit ( );

DESCRIPTION
The exit function terminates a process. Calling exit replaces the running process with the default terminal program. When a process calls exit, all local resources [keyboard, mouse, storage, etc.] are deallocated automatically. Any associated UNIX system process must be terminated separately.

Exit is called automatically when an application program returns from main( ).

When dmdio.h is included, exit acts differently. In addition to the above, it will terminate the host side of jx. Therefore, exit must be called
explicitly by a process downloaded with jx to terminate the host side.

EXAMPLE
The following code fragment shows how a process can exit when a ``q'' is typed.
    #include <dmd.h>
    main()
    {
         char c;

         request (KBD);

         .
         .

         if ( (c = kbdchar()) == 'q')
                 exit();
         .
         .
    }