X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:reply-to:from:date:message-id
	:subject:to:content-type; q=dns; s=default; b=bsEzClfpXzTIYQEFK9
	Q/QVbyM67+rFXf6iKCYfStFH9ZMgFy/20bD7BCfC15eQk517Gp5NCh941JN5TAhz
	qFAqCiaufaxVeo3nqWlTprD9iXdqNZMP575+Al8uWYcPxJ7ynoNI07NRbkjhswvq
	54d1rmppEy+vxiCBHEWQc/aks=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:reply-to:from:date:message-id
	:subject:to:content-type; s=default; bh=1Q4Ru0w6ZTvd1f5r8/8+U4Gi
	Wz8=; b=xfAYAVCsm9f7xx2qexfiI5vZi4CwfK7MHYkRdbggVXMAU21X35JEso0I
	mRL6C9GnqYDC5JDDNKEi9vYYdY043hTgRMjYpWCuIH4qOCJNyWnZDhVWQdRFBxBU
	vb6IhYbInv1N37s5UKXuYsT7ERiEBQd5/XKAFwyV08sPsZA3XHs=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: mail-it1-f180.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20161025;        h=mime-version:reply-to:from:date:message-id:subject:to;        bh=rK09ZudJosodT/nWesYxCTm677ijewJn6DxSiGbPuso=;        b=MVjbPK+t083Esz2Y5sVONlY8cHyIOOBaYmzBpNMXAuxJ3B9q45LOX7d2NRQ9KqfRqb         fxH+iPAxftX31DvqtyKrmuRyXqI3g2Z2BXAg7yD1X3lMWTYrWVvn08g1J6Nr4lCaTZkw         2YxX2OwYwNMWRBMjvgna4HuyCp3fgFKG0+RjgYsNosomb2S7JgXvN0Vc95JqZQtVO88B         HuNHySu/vWe6Ad8MyFciMX6vs30DrHfv0G+BN5yA0CgI/ppgQ5z0WcohU+9+DtW+0kld         LEAqyJqUFfO8NSmQpPdFw8eC477VoM9GIHBNyd+O5TTDQPSYLTluPt0UlJ76sKH/eGYd         OOTQ==
MIME-Version: 1.0
Reply-To: noloader@gmail.com
From: Jeffrey Walton <noloader@gmail.com>
Date: Mon, 11 Feb 2019 12:08:40 -0500
Message-ID: <CAH8yC8ntX=ceRWXAHo_pw2zjzy9-kUWdMEL98vUCGoyBy5vNGQ@mail.gmail.com>
Subject: Is Cygwin supposed to know _get_pgmptr?
To: cygwin@cygwin.com
Content-Type: text/plain; charset="UTF-8"
X-IsSubscribed: yes

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.

Jeff

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

