How can I export atexit and puts?