This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Cygwin: fix CPU_SET macro visibility
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin-patches at cygwin dot com" <cygwin-patches at cygwin dot com>
- Date: Sat, 14 Sep 2019 16:04:30 +0000
- Subject: Re: [PATCH] Cygwin: fix CPU_SET macro visibility
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZUqmvWa/xdA2wwlGjqgT05BGn6g1jS6yjy68wClPq+4=; b=kKiWwYqKXsrjTnmbvGH+mkPDBV3v9G8QclTbsgW3pCVf+4iZ8kyzujlUdSFdBR0vd1kfHyxeZRTM3QFROpW59Hq6hKd6gRri5sDCPcfV9bQQDNMJeTJvlwNRm8589oCXFEqz2lecRE3Q0+APaXf5St41Wvh40lxeIBZ5tm+woFE9+SbYcRZd9442PBKoBoVleRd5eTm73Kn9BgDE7OgSxNk8juZ1WEGdmiSnD9cHMjZAgUnJrw6yddqWWkEBl4slo55NNNWpaGDiqIxIhvI/Tf1RJJiqAYVfgcUxovOzJ5+bUlbvj/9bE3wdr3u74TN3V73jFWYNUBKdMF6GD8YY7g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZAvo7rN8bw8kcsVr0nV2NTb1KQcfKOANeexdQvnj4065FW0/cFjNurg2E1qYGazU7hMiDWdmvxVdVCThFZRU5tTCVg+xi/1aoCu1mRgsNxgoMsxW1ciYrlE9P7zKx35XrUOu26Jiz0AMmAM3azDDNs2dItlyWOduKMp6LGPzNTAdChkSb0Sf8xVTcIVkPT9DhIx1dTnxYEDggsMyWCaKe+wxzMRWHUBgW9LxvkjzAp/aAG7/OJklwc9y+Rn07PMIynWaSdi0SAy59YHjZozJJCpNFoyGuJihHpQX5W8C/T+FSBax0Tv8CEi9CREjHTDpA1lUeAMZPTnjZVLM2K7I0Q==
- References: <855a9543-6908-42f0-576a-0f161777f715@ssi-schaefer.com> <20190914045802.693-1-mark@maxrnd.com>
On 9/14/2019 12:58 AM, Mark Geisert wrote:
> The CPU_SET macros defined in Cygwin's include/sys/cpuset.h must not
> be visible in an application's namespace unless _GNU_SOURCE has been
> #defined. Internally this means wrapping them in #if __GNU_VISIBLE.
>
> ---
> winsup/cygwin/include/sys/cpuset.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/winsup/cygwin/include/sys/cpuset.h b/winsup/cygwin/include/sys/cpuset.h
> index 2056f6af7..1adf48d54 100644
> --- a/winsup/cygwin/include/sys/cpuset.h
> +++ b/winsup/cygwin/include/sys/cpuset.h
> @@ -26,6 +26,7 @@ typedef struct
> __cpu_mask __bits[__CPU_GROUPMAX];
> } cpu_set_t;
>
> +#if __GNU_VISIBLE
> int __sched_getaffinity_sys (pid_t, size_t, cpu_set_t *);
>
> /* These macros alloc or free dynamically-sized cpu sets of size 'num' cpus.
> @@ -88,6 +89,8 @@ int __sched_getaffinity_sys (pid_t, size_t, cpu_set_t *);
> #define CPU_XOR(dst, src1, src2) CPU_XOR_S(sizeof (cpu_set_t), dst, src1, src2)
> #define CPU_EQUAL(src1, src2) CPU_EQUAL_S(sizeof (cpu_set_t), src1, src2)
>
> +#endif /* __GNU_VISIBLE */
> +
> #ifdef __cplusplus
> }
> #endif
Pushed. Thanks.
Ken