public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: "Xinjian Ma (Fujitsu)" <maxj.fnst@fujitsu.com>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] posix/conformance/interfaces/sem_timedwait/2-1: add _GNU_SOURCE define
Date: Tue, 17 Sep 2024 16:16:42 +0200	[thread overview]
Message-ID: <ZumPSk0VdqFa5Eqn@yuki.lan> (raw)
In-Reply-To: <TY3PR01MB12071A725A400AA4C08040DBFE8652@TY3PR01MB12071.jpnprd01.prod.outlook.com>

Hi!
> > That does not sound right, the open posix testsuite must not depend on anything
> > GNU specific.
> 
> I see. Thanks.
> But I tested both on Fedora and Ubuntu, they reported the same error
> if using the params " -std=c99 -D_POSIX_C_SOURCE=200809L
> -D_XOPEN_SOURCE=700" for gcc.

That is certainly unexpected. I managed to reproduce this on Debian 12.

Looks that on certain systems the MMAP_ANONYMOUS seems to be guarded by
__USE_MISC. The __USE_MISC is defined in /usr/include/features.h and set
if _DEFAULT_SOURCE is set which is set by _GNU_SOURCE.

I did double check the POSIX and I was probably confusing MAP_PRIVATE
and MAP_ANONYMOUS, sorry. Looks like MAP_ANONYMOUS is indeed not a part
of POSIX.

> How about manually defining MAP_ANONYMOUS like below?

Does not seem to be a good solution either, that will work only on
Linux. The open posix testsuite is supposed to run on any POSIX
compatible OS.

I'm afraid that the only solution we can use is to allocate the shared
memory via the posix shm. That means to get the file descriptor for
mmap() from shm_open() (followed by shm_unlink()).

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-09-17 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  9:47 [LTP] [PATCH] posix/conformance/interfaces/sem_timedwait/2-1: add _GNU_SOURCE define Ma Xinjian via ltp
2024-09-10 10:11 ` Cyril Hrubis
2024-09-13  4:07   ` Xinjian Ma (Fujitsu) via ltp
2024-09-17 14:16     ` Cyril Hrubis [this message]
2024-09-19  3:38       ` Xinjian Ma (Fujitsu) via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZumPSk0VdqFa5Eqn@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=maxj.fnst@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox