From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3787220248 for ; Sat, 23 Mar 2019 21:05:44 +0000 (UTC) Received: from localhost ([127.0.0.1]:48104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7npl-0005T6-Qz for normalperson@yhbt.net; Sat, 23 Mar 2019 17:05:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7nk5-0000o4-HI for bug-gnulib@gnu.org; Sat, 23 Mar 2019 16:59:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7nXH-0003cc-Nb for bug-gnulib@gnu.org; Sat, 23 Mar 2019 16:46:37 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::9]:14635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h7nXG-0003au-LS for bug-gnulib@gnu.org; Sat, 23 Mar 2019 16:46:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1553373992; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=WZBZI09pJTARl9M/h/g84l1kvZ1gUNII5MfjOsqtSFk=; b=CmUs+zA4kYGik0WnMEZpJ2yYQapCR8RJb7IdxEQSc3dsB2EuAS6Xy8TbsfyHBnuRQX NN+yojkmMCv4xPr3XkX7UzE205H0BUm/E7YuW7Dr50ha0vgBaMrYGLlmdtQumstXTY3K X4NjVI1jDx9ihf8U08T3LdeuyawhqtpHMcXpDH9tMEz7pVGr2QaHC/181lbn5kjkrNap A8CCrmojCl3jLr6gLF6TMDxDraNgZ+MaDC1SG+M8u1la/gSKs9b8cTl6RZB+AqfTZ4YR L7fM2yC/m2Up5CrOd3YagqW8XFz7+vzEWt2CLyRSH4h3u7rr4xLejKMsTBmmNpnNmNCi n/bA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGKf3zZFW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 44.16 DYNA|AUTH) with ESMTPSA id 5094e6v2NKkSnrt (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 23 Mar 2019 21:46:28 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org, Rich Felker Subject: posix_spawn_file_actions_add* functions on musl libc Date: Sat, 23 Mar 2019 21:46:28 +0100 Message-ID: <17480807.kbxdrRNLtY@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::9 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" The gnulib configure test in m4/posix_spawn.m4, when run on Alpine Linux 3.7, determines that the posix_spawn_file_actions_add* functions do not fail as expected for an out-of-range file descriptor. Let me document this in gnulib and update the cross-compilation guess accordingly. Rich, FYI: These are the test programs: #include int main () { posix_spawn_file_actions_t actions; if (posix_spawn_file_actions_init (&actions) != 0) return 1; if (posix_spawn_file_actions_addclose (&actions, 10000000) == 0) return 2; return 0; } #include int main () { posix_spawn_file_actions_t actions; if (posix_spawn_file_actions_init (&actions) != 0) return 1; if (posix_spawn_file_actions_adddup2 (&actions, 10000000, 2) == 0) return 2; return 0; } #include #include int main () { posix_spawn_file_actions_t actions; if (posix_spawn_file_actions_init (&actions) != 0) return 1; if (posix_spawn_file_actions_addopen (&actions, 10000000, "foo", 0, O_RDONLY) == 0) return 2; return 0; } 2019-03-23 Bruno Haible posix_spawn_file_actions_*: Document musl libc bugs. * doc/posix-functions/posix_spawn_file_actions_addclose.texi: Mention the bug. * doc/posix-functions/posix_spawn_file_actions_adddup2.texi: Likewise. * doc/posix-functions/posix_spawn_file_actions_addopen.texi: Likewise. * m4/posix_spawn.m4 (gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE): When cross-compiling to a musl system, guess no. (gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2): Likewise. (gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN): Likewise. diff --git a/doc/posix-functions/posix_spawn_file_actions_addclose.texi b/doc/posix-functions/posix_spawn_file_actions_addclose.texi index 199daa1..80418db 100644 --- a/doc/posix-functions/posix_spawn_file_actions_addclose.texi +++ b/doc/posix-functions/posix_spawn_file_actions_addclose.texi @@ -13,7 +13,7 @@ This function is missing on some platforms: Mac OS X 10.4, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 8.1. @item This function does not reject a too large file descriptor on some platforms: -Solaris 11.4. +musl libc, Solaris 11.4. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/posix_spawn_file_actions_adddup2.texi b/doc/posix-functions/posix_spawn_file_actions_adddup2.texi index e515715..985d6bc 100644 --- a/doc/posix-functions/posix_spawn_file_actions_adddup2.texi +++ b/doc/posix-functions/posix_spawn_file_actions_adddup2.texi @@ -13,7 +13,7 @@ This function is missing on some platforms: Mac OS X 10.4, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 8.1. @item This function does not reject a too large file descriptor on some platforms: -Solaris 11.4. +musl libc, Solaris 11.4. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/posix-functions/posix_spawn_file_actions_addopen.texi b/doc/posix-functions/posix_spawn_file_actions_addopen.texi index a7809cf..eea56e3 100644 --- a/doc/posix-functions/posix_spawn_file_actions_addopen.texi +++ b/doc/posix-functions/posix_spawn_file_actions_addopen.texi @@ -13,7 +13,7 @@ This function is missing on some platforms: Mac OS X 10.4, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin, mingw, MSVC 14, Interix 3.5, BeOS, Android 8.1. @item This function does not reject a too large file descriptor on some platforms: -Solaris 11.4. +musl libc, Solaris 11.4. @end itemize Portability problems not fixed by Gnulib: diff --git a/m4/posix_spawn.m4 b/m4/posix_spawn.m4 index 1e2533c..d50dcc9 100644 --- a/m4/posix_spawn.m4 +++ b/m4/posix_spawn.m4 @@ -1,4 +1,4 @@ -# posix_spawn.m4 serial 15 +# posix_spawn.m4 serial 16 dnl Copyright (C) 2008-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -422,8 +422,8 @@ AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE], if test $REPLACE_POSIX_SPAWN = 1; then REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 else - dnl On Solaris 11.0, posix_spawn_file_actions_addclose succeeds even - dnl if the fd argument is out of range. + dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_addclose + dnl succeeds even if the fd argument is out of range. AC_CACHE_CHECK([whether posix_spawn_file_actions_addclose works], [gl_cv_func_posix_spawn_file_actions_addclose_works], [AC_RUN_IFELSE( @@ -440,8 +440,9 @@ int main () }]])], [gl_cv_func_posix_spawn_file_actions_addclose_works=yes], [gl_cv_func_posix_spawn_file_actions_addclose_works=no], - [# Guess no on Solaris, yes otherwise. + [# Guess no on musl libc and Solaris, yes otherwise. case "$host_os" in + *-musl*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; # Guess no on native Windows. mingw*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; @@ -465,8 +466,8 @@ AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2], if test $REPLACE_POSIX_SPAWN = 1; then REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 else - dnl On Solaris 11.0, posix_spawn_file_actions_adddup2 succeeds even - dnl if the fd argument is out of range. + dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_adddup2 + dnl succeeds even if the fd argument is out of range. AC_CACHE_CHECK([whether posix_spawn_file_actions_adddup2 works], [gl_cv_func_posix_spawn_file_actions_adddup2_works], [AC_RUN_IFELSE( @@ -483,8 +484,9 @@ int main () }]])], [gl_cv_func_posix_spawn_file_actions_adddup2_works=yes], [gl_cv_func_posix_spawn_file_actions_adddup2_works=no], - [# Guess no on Solaris, yes otherwise. + [# Guess no on musl libc and Solaris, yes otherwise. case "$host_os" in + *-musl*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";; solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";; # Guess no on native Windows. mingw*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no" ;; @@ -508,8 +510,8 @@ AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN], if test $REPLACE_POSIX_SPAWN = 1; then REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 else - dnl On Solaris 11.0, posix_spawn_file_actions_addopen succeeds even - dnl if the fd argument is out of range. + dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_addopen + dnl succeeds even if the fd argument is out of range. AC_CACHE_CHECK([whether posix_spawn_file_actions_addopen works], [gl_cv_func_posix_spawn_file_actions_addopen_works], [AC_RUN_IFELSE( @@ -528,8 +530,9 @@ int main () }]])], [gl_cv_func_posix_spawn_file_actions_addopen_works=yes], [gl_cv_func_posix_spawn_file_actions_addopen_works=no], - [# Guess no on Solaris, yes otherwise. + [# Guess no on musl libc and Solaris, yes otherwise. case "$host_os" in + *-musl*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";; solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";; # Guess no on native Windows. mingw*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no" ;;