Brendan Doyle writes: > James Carlson wrote: > > These variables are GNU extensions, and should not be used in > > programs intended to be portable. > > > Yeah I'm aware of that, but I didn't write the lib. I'm just trying to > port it and then > contribute it back to an Open Source community that currently doesn't > support Solaris, > and is resistant to any OS specific #defines.
They've already got OS-specific code. The only question is what to do about it. > I guess I may have to do this or something like it, I was trying to > avoid adding > Solaris specific (I guess to be more correct non GNU specific) stuff to > the source > though. Another possibility would be to define your own global variable called program_invocation_short_name and create a non-GNU function that initializes it. You can then use "-zinitarray=yourfunction" when linking the program to arrange to have that function called before anything else is called. > > Still another way to deal with it would be to file an RFE and change > > libc to include this "feature" ... > > > > Will do, but what are the chances of that getting done any time soon? Better if you find a volunteer. But (as another poster pointed out) it's likely that it would end up only in OpenSolaris. I don't know what your plans are, but if they include only OpenSolaris, that might not be too much of a problem. -- James Carlson, Solaris Networking <james.d.carlson at sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
