pcp
[Top] [All Lists]

Re: [pcp] POSIX version

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, pcp@xxxxxxxxxxx
Subject: Re: [pcp] POSIX version
From: Martins Innus <minnus@xxxxxxxxxxx>
Date: Thu, 30 Apr 2015 09:20:03 -0400
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <55414129.4090000@xxxxxxxxxxxxxxxx>
References: <55412913.4080603@xxxxxxxxxxx> <55414129.4090000@xxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
Ken,
On 4/29/2015 4:38 PM, Ken McDonell wrote:

We don't really have a formal position on a POSIX version that the code is expected to comply with, other than the (old) -D_GNU_SOURCE in the build which sort of means we can never be POSIX compliant (sigh).

This is in part because the POSIX story is confusing across all the platforms we're trying to support, or at least was so at points of time over the last 20+ years.

Rather we've gone down the path of isolating source code that is not necessarily portable across all the platforms using HAVE_FOO macros ... in this case it would be HAVE_OPEN_MEMSTREAM. This works fine in cases where the feature provides isolated functionality and the #else path can either do nothing or return a relevant error such as PM_ERR_APPVERSION.

Yeah, not the case here, as it would preclude use of the pmda.

But in this case I think you'd either have to
(a) assert that open_memstream() is available on any Linux platform where PCP is expected to compile and just do it, or (b) keep the existing implementation for the #else part and use open_memstream() for an alternative (new and default) implementation behind the #ifdef HAVE_OPEN_MEMSTREAM

The more I think about it, any change will probably add more complexity, so not worth it.

Thanks

Martins

<Prev in Thread] Current Thread [Next in Thread>