Welcome to mirror list, hosted at ThFree Co, Russian Federation.

atexit.c « lib « cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b724771a7a5032b47a92a15e6dbb74e549fac98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* atexit.c: atexit entry point

   Copyright 2014 Red Hat, Inc.

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

#include <stddef.h>

/* Statically linked replacement for the former cygwin_atexit.  We need
   the function here to be able to access the correct __dso_handle of the
   caller's DSO. */
int
atexit (void (*fn) (void))
{
  extern int __cxa_atexit(void (*)(void*), void*, void*);
  extern void *__dso_handle;

  return __cxa_atexit ((void (*)(void*))fn, NULL, &__dso_handle);
}