From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3zZCKYgcKCjQcQiahQoWeeWbU.SecbYRS-QbfXQiekhSUmQhU.ehW@flex--maskray.bounces.google.com> Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by sourceware.org (Postfix) with ESMTPS id 8108A382A6F9 for ; Sun, 22 May 2022 19:36:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8108A382A6F9 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-2f8398e99dcso112199837b3.9 for ; Sun, 22 May 2022 12:36:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=jxaFP17dKmwlv3yEZGsf6Jhyr3qVE3WjoibErGFXQaM=; b=PNs99/ws7r0H5ssw9kJ8ZcsapmG3jnveFlxce7eRfZKUyR/IgIyraJSO/lTPZ1irxi i+ejeUQLf9TBFVFYFM/L9Yvk9CEL3EKN0UfsWCb5Y/cYpbIpodAxmEqRuuFhNED8eC8e hcWsAshfK5Wl9QhrNdsVOUm2LHVj0Op26PX8KnGridxJF+oZ+Zp5B3aDXikzHeWDGysq zEt/dPgqWFDd/BtFDeIWjwH4TqN2tDxgC7Eh5FYK5XXOWfJysf6S08YrGJ33cODXYXHy PkiXb0tCUykntJju4STGv7pYgmAr03LK+wg/7uf86pVZ90qEH/N5VICygUhanZq3XdT7 Pgiw== X-Gm-Message-State: AOAM531Dydw7fXxnF6eKOSlz5w03h0b293ip/YfD2Sea4NqWu+41vQLo BR8FTyc1YLk4QeTSOQMlUIdBOmZHG2RoD7csZFmlg28XhZk7x2qQ3V0FwRAw26LzzgficSdV29H YlwhHu+pRH3DC7rZJiP/tH4cES8FCSb/tDp1H1+TKRsgKuuxcJdIeTxuLHCp7x/M5c1jv X-Google-Smtp-Source: ABdhPJyvJUDrewXNCgpDxDgPk5sY9WDJ+DlkLOlkPWi1YiBzThbYXBw/TTXBqHfSWc9nK5rcScCS+gE9325H X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:2d1f:7f25:dd1a:a985]) (user=maskray job=sendgmr) by 2002:a25:9081:0:b0:64d:d424:a811 with SMTP id t1-20020a259081000000b0064dd424a811mr18549593ybl.298.1653248205849; Sun, 22 May 2022 12:36:45 -0700 (PDT) Date: Sun, 22 May 2022 12:36:42 -0700 Message-Id: <20220522193642.3598646-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] dlfcn: Move RTLD_DEFAULT/RTLD_NEXT outside __USE_GNU From: Fangrui Song To: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-19.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2022 19:36:47 -0000 RTLD_DEFAULT and RTLD_NEXT appear in IEEE Std 1003.1-2004. (RTLD_NEXT even appears in the 1997 SUS version 2.) Many systems (e.g. FreeBSD, musl) just define the two macros unconditionally. Let's do the same, as if the state before commit 70b2845f71c1fb6bd5ec3ef325974b6a90cdb45c. --- dlfcn/dlfcn.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dlfcn/dlfcn.h b/dlfcn/dlfcn.h index a3af6051d4..6be06241d1 100644 --- a/dlfcn/dlfcn.h +++ b/dlfcn/dlfcn.h @@ -30,6 +30,14 @@ #ifdef __USE_GNU #include +/* Type for namespace indices. */ +typedef long int Lmid_t; + +/* Special namespace ID values. */ +# define LM_ID_BASE 0 /* Initial namespace. */ +# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ +#endif + /* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT the run-time address of the symbol called NAME in the next shared object is returned. The "next" relation is defined by the order @@ -41,16 +49,6 @@ is returned. */ # define RTLD_DEFAULT ((void *) 0) - -/* Type for namespace indices. */ -typedef long int Lmid_t; - -/* Special namespace ID values. */ -# define LM_ID_BASE 0 /* Initial namespace. */ -# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ -#endif - - __BEGIN_DECLS /* Open the shared object FILE and map it in; return a handle that can be -- 2.36.1.124.g0e6072fb45-goog