_fini

Is a prototype for shutdown code for a UNIX style library.

Library:LibC
Classification:Other
Service:File and Directory I/O

Syntax

  #include <unistd.h> 
   
  int _fini ( void );
  

Return Values

If successful in cleaning up your resources, the _fini function should return 0. Any other value indicates an error.

Remarks

The _fini function prepares your library for unloading and should perform any required resource clean up so that your library can unload cleanly. You should write an _fini function only if you have also written an _init function to initialize your library.

See Also

Sample Code

Don’t write a _fini function without first implementing an _init function.

  int _fini( void ) 
  {
      if (initted)
          pthread_key_delete(gKey);
  
      return 0;
  }