Re: [go-nuts] How to set a callback for cgo ?

2019-01-16 Thread astone . chou
sorry for late reply. thanks very much. it got the key. 在 2019年1月11日星期五 UTC+8下午10:09:17,Jan Mercl写道: > > > On Fri, Jan 11, 2019 at 2:49 PM > wrote: > > > I get the file 'exit0', but didn't get the file 'exit1'. > > As far as I can tell, it works as expected. Exit handlers are called when > libc's

[go-nuts] How to set a callback for cgo ?

2019-01-11 Thread astone . chou
Hi everyone, I want to set a callback for atexit, but it seems doesn't work. This is my code. package main /* #include extern void AtExit(); static inline set_atexit() { atexit(AtExit); AtExit(); } */ import "C" import ( "fmt" "io/ioutil" "time" ) var n = 0 //expor