Web lists-archives.com

Re: Is Cygwin supposed to know _get_pgmptr?




On Feb 11 12:08, Jeffrey Walton wrote:
> Hi Everyone,
> 
> I have some code that looks like so:
> 
> #if defined(_WINDOWS)
>     char* pgmptr = NULLPTR;
>     errno_t err = _get_pgmptr(&pgmptr);
>     if (err == 0 && pgmptr != NULLPTR)
>         exePath = pgmptr;
> #endif
> 
> The code gets the full path of the executable. It sidsteps some
> problems with finding the full path of an executable. Posix realpath
> is a little messier and has some inherent problem with path lengths.
> 
> The code fails to compile with Cygwin.
> 
> I am wondering if the failure is expected.

Yes.  This is a Windowism which is not supported.

Use http://man7.org/linux/man-pages/man3/program_invocation_name.3.html
instead.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature