on_exit(...) function

jsika

New Member


Messages: 3

Could somebody tell me how to replace a missing function on_exit? It's a little bit non-standard, available under Linux, but very useful. I need to pass args that atexit cannot. 🧐
 

_martin

Aspiring Daemon

Reaction score: 169
Messages: 818

I don't know if this is possible. As a suggestion maybe to use atexit() with the combination of global variable that will serve the purpose of the argument.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,210
Messages: 31,923

This function comes from SunOS 4, but is also present in glibc. It
no longer occurs in Solaris (SunOS 5). Portable application should
avoid this function, and use the standard atexit(3) instead.
From the on_exit(3) man page.
 

_martin

Aspiring Daemon

Reaction score: 169
Messages: 818

SirDice Well, if he's porting the SW it might be that he needs to find a workaround. Not using it may not be an option (depends).
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 8,210
Messages: 31,923

True. But that isn't really clear from the original question. It might be an application jsika wrote himself.
 
Top