AIX equivalent to /proc/self/cmdline to get process name from C++ program

Hi,
I'm porting some old C++ code (that I didn't write) from Linux to AIX and have run into a problem in getting the process name from within the code when it is run on AIX. Basically the code is getting the process name so it can then return it to the rest of the code as argv[0]. This code is trying to name logfiles using the process name and is called by many other classes.
The OS is: powerpc-ibm-aix5.3.0.0
The gcc is: gcc version 4.2.0

The code is below:

static const std::string getArg0(void)
    {
#if defined(__hpux__) || defined(__hpux)
    extern char** __argv_value; // see man crt0 on HP-UX.
    return __argv_value[0];
#elif defined(__linux__)
    static std::string argv;
    static bool first = true;
    if (first)
        {
        first = false;
        std::ifstream is("/proc/self/cmdline");
        if (!is)
            argv = "unknown";
        else
            {
            std::ostringstream os;
            char buf;
            while (true)
                {
                is.get(buf);
                if (!is)
                    break;
                if (!isspace(buf))
                    os << buf;
                else
                    break;
                }
            os << std::ends;
            argv = os.str();
            is.close();
            }
        }
        return argv;
#elif defined(_AIX)
    extern char** argv;
    return argv[0];
#else
    return "unknown";
#endif
    }

// -- public -----------------------------------------------------------------
// getProcName()
//
// Determine the process name and return it.
//
// -- implementation ---------------------------------------------------------
// Since this is called before main(), we can't use argv.  But the C run time
// startup code sets argv from the global __argv_value, so just use that.
// ---------------------------------------------------------------------------
TextString LogStream::getProcName(bool useFullPath)
    {
      // LAB - GCC upgrade syntax change
    static TextString fullName(getArg0().c_str());
    static TextString leafOnly(basename((char *)fullName.stringPtr()));
    return useFullPath ? fullName : leafOnly;
    }

I intially added "|| _AIX" to the linux block above but since AIX doesn't have /proc/self it failed and all my logfiles are named unknown*. I have tried several different separate blocks for AIX, but after hours of searching for how to get the process name I've hit a wall. I am able to compile, but always get an undefined error on the link. How do I duplicate the above blocks used for linux and (ancient hp block) for AIX?

Any help is greatly appreciated! Thanks..
Tom

There might be some clues from the "truss" output, although I admit I haven't found it myself.

truss -o /tmp/hosts-trace bash -c 'echo $0'