From unknown Sat Aug 16 20:58:51 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9141 <9141@debbugs.gnu.org> To: bug#9141 <9141@debbugs.gnu.org> Subject: Status: Coreutils Compiler Warnings on OSX 10.7 (Lion) Reply-To: bug#9141 <9141@debbugs.gnu.org> Date: Sun, 17 Aug 2025 03:58:51 +0000 retitle 9141 Coreutils Compiler Warnings on OSX 10.7 (Lion) reassign 9141 coreutils submitter 9141 Herb Wartens severity 9141 normal tag 9141 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 12:04:17 2011 Received: (at submit) by debbugs.gnu.org; 21 Jul 2011 16:04:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QjvjU-0002zM-W0 for submit@debbugs.gnu.org; Thu, 21 Jul 2011 12:04:17 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QjpN7-0001RF-V2 for submit@debbugs.gnu.org; Thu, 21 Jul 2011 05:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjpN2-00069B-18 for submit@debbugs.gnu.org; Thu, 21 Jul 2011 05:16:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:60302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjpN1-000697-Ub for submit@debbugs.gnu.org; Thu, 21 Jul 2011 05:16:39 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjpN0-00081K-RI for bug-coreutils@gnu.org; Thu, 21 Jul 2011 05:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjpMz-00068p-GM for bug-coreutils@gnu.org; Thu, 21 Jul 2011 05:16:38 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:59735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjpMz-00068f-BO for bug-coreutils@gnu.org; Thu, 21 Jul 2011 05:16:37 -0400 Received: by iyb14 with SMTP id 14so860266iyb.0 for ; Thu, 21 Jul 2011 02:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; bh=S6e7PSs3N0RALmMLhHI5MFJKX/aql/9KTnoH7mFHq9g=; b=WSFzZYQgbwdwgQoTuFU/tQTDR0mwRqKRV846e14z4mn/m8F8fjoOBu2otiQ92CbSBv LGAWQ1Z5KIx8HMyGU0L6dPc5lhimq+Dvc+VS4ImveY2pGqzm/uJcU9sGUxwxwF/oSKzs z9t+OLSmtKShZn+EoOwLbVMI7M26XQA7o6sp0= Received: by 10.231.42.155 with SMTP id s27mr11131ibe.68.1311239796493; Thu, 21 Jul 2011 02:16:36 -0700 (PDT) Received: from [192.168.101.145] (76-247-188-17.lightspeed.sntcca.sbcglobal.net [76.247.188.17]) by mx.google.com with ESMTPS id az3sm1612786icb.0.2011.07.21.02.16.33 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jul 2011 02:16:35 -0700 (PDT) From: Herb Wartens Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: multipart/mixed; boundary="Apple-Mail=_1A2D3209-22BD-4221-96CD-46685C2594EA" Subject: Coreutils Compiler Warnings on OSX 10.7 (Lion) Date: Thu, 21 Jul 2011 02:16:32 -0700 In-Reply-To: To: bug-coreutils@gnu.org References: Message-Id: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> X-Mailer: Apple Mail (2.1244.3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 21 Jul 2011 12:04:16 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --Apple-Mail=_1A2D3209-22BD-4221-96CD-46685C2594EA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii OSX does have fdatasync defined as part of the libsystem_kernel.dylib = library. The problem is that there is no header on OSX that actually = provides the function. =20 There is another issue where I redefined PRIuMAX to "llu" and PRIdMAX to = "lld" on OSX. This was necessary because the build was picking up the = lib/stdint.h provided with coreutils. In there we ended up defining = uintmax_t as a uint64_t. #elif defined GL_UINT64_T # define uintmax_t uint64_t #else However by default on OSX, PRIdMAX is defined as "jd" and PRIuMAX is = defined as "ju." I have added a hack to get coreutils to compile cleanly on OSX. Hope = this helps. -Herb --Apple-Mail=_1A2D3209-22BD-4221-96CD-46685C2594EA Content-Disposition: attachment; filename=coreutils_warnings.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="coreutils_warnings.diff" Content-Transfer-Encoding: 7bit --- coreutils-8.12/src/dd.c 2011-04-26 00:05:08.000000000 -0700 +++ coreutils-8.12/src/dd.c 2011-07-21 01:43:03.000000000 -0700 @@ -99,6 +99,14 @@ OFF_T_MAX, for the benefit of the large-offset seek code. */ #define MAX_BLOCKSIZE(slop) MIN (SIZE_MAX - (slop), MIN (SSIZE_MAX, OFF_T_MAX)) +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +#define DARWIN7 +#undef PRIuMAX +#define PRIuMAX "llu" +extern int fdatasync(int); +#endif + + /* Conversions bit masks. */ enum { --- coreutils-8.12/src/getlimits.c 2011-02-19 09:17:03.000000000 -0800 +++ coreutils-8.12/src/getlimits.c 2011-07-21 01:49:03.000000000 -0700 @@ -55,6 +55,14 @@ #define UID_T_MIN 0 #define GID_T_MIN 0 +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +#define DARWIN7 +#undef PRIdMAX +#undef PRIuMAX +#define PRIdMAX "lld" +#define PRIuMAX "llu" +#endif + void usage (int status) { --- coreutils-8.12/src/md5sum.c 2011-04-25 02:45:49.000000000 -0700 +++ coreutils-8.12/src/md5sum.c 2011-07-21 01:44:18.000000000 -0700 @@ -102,6 +102,12 @@ + 2 /* blank and binary indicator */ \ + 1 /* minimum filename length */ ) +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +#define DARWIN7 +#undef PRIuMAX +#define PRIuMAX "llu" +#endif + /* True if any of the files read were the standard input. */ static bool have_read_stdin; --- coreutils-8.12/src/pr.c 2011-04-25 02:45:49.000000000 -0700 +++ coreutils-8.12/src/pr.c 2011-07-21 01:45:31.000000000 -0700 @@ -336,6 +336,12 @@ the horizontal position start_position. */ #define ANYWHERE 0 +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +#define DARWIN7 +#undef PRIuMAX +#define PRIuMAX "llu" +#endif + /* Each column has one of these structures allocated for it. If we're only dealing with one file, fp is the same for all columns. --- coreutils-8.12/src/shred.c 2011-02-19 09:17:03.000000000 -0800 +++ coreutils-8.12/src/shred.c 2011-07-21 01:50:16.000000000 -0700 @@ -101,6 +101,11 @@ #include "randint.h" #include "randread.h" +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +#define DARWIN7 +extern int fdatasync(int); +#endif + /* Default number of times to overwrite. */ enum { DEFAULT_PASSES = 3 }; --- coreutils-8.12/src/truncate.c 2011-02-19 09:17:03.000000000 -0800 +++ coreutils-8.12/src/truncate.c 2011-07-21 01:52:48.000000000 -0700 @@ -36,6 +36,12 @@ #define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady") +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +#define DARWIN7 +#undef PRIdMAX +#define PRIdMAX "lld" +#endif + /* (-c) If true, don't create if not already there */ static bool no_create; --- coreutils-8.12/src/uniq.c 2011-04-25 02:45:49.000000000 -0700 +++ coreutils-8.12/src/uniq.c 2011-07-21 01:50:44.000000000 -0700 @@ -51,6 +51,12 @@ } \ while (0) +#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET +#define DARWIN7 +#undef PRIuMAX +#define PRIuMAX "llu" +#endif + /* True if the LC_COLLATE locale is hard. */ static bool hard_LC_COLLATE; --Apple-Mail=_1A2D3209-22BD-4221-96CD-46685C2594EA-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 17:53:35 2011 Received: (at 9141) by debbugs.gnu.org; 21 Jul 2011 21:53:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk1BX-0003L6-7U for submit@debbugs.gnu.org; Thu, 21 Jul 2011 17:53:35 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk1BU-0003Ks-MX for 9141@debbugs.gnu.org; Thu, 21 Jul 2011 17:53:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1DF6639E80FA; Thu, 21 Jul 2011 14:53:27 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GtnG7BoFyY10; Thu, 21 Jul 2011 14:53:26 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 4237639E80E0; Thu, 21 Jul 2011 14:53:26 -0700 (PDT) Message-ID: <4E289FD5.3010806@cs.ucla.edu> Date: Thu, 21 Jul 2011 14:53:25 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 MIME-Version: 1.0 To: Herb Wartens Subject: Re: bug#9141: Coreutils Compiler Warnings on OSX 10.7 (Lion) References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> In-Reply-To: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) [Adding bug-gnulib; the original bug report is .] On 07/21/11 02:16, Herb Wartens wrote: > I have added a hack to get coreutils to compile cleanly on OSX. Thanks, but we should fix this problem more cleanly. Does the following patch to lib/stdint.in.h solve your problem? This fix is already scheduled to appear in the next version of coreutils. If it doesn't solve your problem, what are the symptoms of failure? --- old/lib/stdint.in.h 2011-03-13 04:32:31.000000000 -0700 +++ new/lib/stdint.in.h 2011-07-21 14:47:33.901160610 -0700 @@ -272,6 +272,12 @@ typedef unsigned long int gl_uintptr_t; /* Note: These types are compiler dependent. It may be unwise to use them in public header files. */ +/* If the system defines INTMAX_MAX, assume that intmax_t works, and + similarly for UINTMAX_MAX and uintmax_t. This avoids problems with + assuming one type where another is used by the system. */ + +#ifndef INTMAX_MAX +# undef INTMAX_C #undef intmax_t #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; @@ -282,7 +288,10 @@ typedef long long int gl_intmax_t; typedef long int gl_intmax_t; # define intmax_t gl_intmax_t #endif +#endif +#ifndef UINTMAX_MAX +# undef UINTMAX_C #undef uintmax_t #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; @@ -293,6 +302,7 @@ typedef unsigned long long int gl_uintma typedef unsigned long int gl_uintmax_t; # define uintmax_t gl_uintmax_t #endif +#endif /* Verify that intmax_t and uintmax_t have the same size. Too much code breaks if this is not the case. If this check fails, the reason is likely @@ -433,8 +443,8 @@ typedef int _verify_intmax_size[sizeof ( /* 7.18.2.5. Limits of greatest-width integer types */ +#ifndef INTMAX_MAX #undef INTMAX_MIN -#undef INTMAX_MAX #ifdef INT64_MAX # define INTMAX_MIN INT64_MIN # define INTMAX_MAX INT64_MAX @@ -442,13 +452,15 @@ typedef int _verify_intmax_size[sizeof ( # define INTMAX_MIN INT32_MIN # define INTMAX_MAX INT32_MAX #endif +#endif -#undef UINTMAX_MAX +#ifndef UINTMAX_MAX #ifdef UINT64_MAX # define UINTMAX_MAX UINT64_MAX #else # define UINTMAX_MAX UINT32_MAX #endif +#endif /* 7.18.3. Limits of other integer types */ @@ -570,7 +582,7 @@ typedef int _verify_intmax_size[sizeof ( /* 7.18.4.2. Macros for greatest-width integer constants */ -#undef INTMAX_C +#ifndef INTMAX_C #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 # define INTMAX_C(x) x##LL #elif defined GL_INT64_T @@ -578,8 +590,9 @@ typedef int _verify_intmax_size[sizeof ( #else # define INTMAX_C(x) x##L #endif +#endif -#undef UINTMAX_C +#ifndef UINTMAX_C #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 # define UINTMAX_C(x) x##ULL #elif defined GL_UINT64_T @@ -587,6 +600,7 @@ typedef int _verify_intmax_size[sizeof ( #else # define UINTMAX_C(x) x##UL #endif +#endif #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 18:08:22 2011 Received: (at 9141) by debbugs.gnu.org; 21 Jul 2011 22:08:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk1Pq-0003f2-2H for submit@debbugs.gnu.org; Thu, 21 Jul 2011 18:08:22 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk1Po-0003er-Ny for 9141@debbugs.gnu.org; Thu, 21 Jul 2011 18:08:21 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 29B9E39E80FA; Thu, 21 Jul 2011 15:08:15 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X0x7b8oH7uMG; Thu, 21 Jul 2011 15:08:14 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 916FD39E80E0; Thu, 21 Jul 2011 15:08:14 -0700 (PDT) Message-ID: <4E28A34E.4040107@cs.ucla.edu> Date: Thu, 21 Jul 2011 15:08:14 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 MIME-Version: 1.0 To: Herb Wartens Subject: Re: bug#9141: Coreutils Compiler Warnings on OSX 10.7 (Lion) References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> In-Reply-To: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) On 07/21/11 02:16, Herb Wartens wrote: > OSX does have fdatasync defined as part of the libsystem_kernel.dylib library. > The problem is that there is no header on OSX that actually provides the function. Thanks again for reporting this. What is the exact symptom of failure here? If 'configure' successfully linked to fdatasync, then presumably coreutils can link to it too. So presumably your compiler complained about the missing declaration. But did it go ahead and use fdatasync anyway? If so, we're done: you can just ignore the diagnostic. If not, perhaps 'configure' should check that fdatasync is declared (and not just linkable too), and use fdatasync only if it is declared; that would be more-conservative. Have you checked, via "grep -r fdatasync /usr/include/", whether fdatasync is actually present anywhere? It might be declared only if some other symbol is #define'd, in which case, we should find out what that is and #define it. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 19:08:32 2011 Received: (at 9141) by debbugs.gnu.org; 21 Jul 2011 23:08:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk2M3-00050f-Ki for submit@debbugs.gnu.org; Thu, 21 Jul 2011 19:08:31 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk2Ey-0004qn-VO for 9141@debbugs.gnu.org; Thu, 21 Jul 2011 19:01:13 -0400 Received: by wwf25 with SMTP id 25so1679706wwf.15 for <9141@debbugs.gnu.org>; Thu, 21 Jul 2011 16:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=jotZ/yyQscD+8SEOJ/vhvJEl9VR0eFnkOCURZWzNHOc=; b=mxRlvUIWRnmRQJ7SWY0R03s2DewGezPHpgJcymvtPd6u74oxHqZn5t5x++xOdRzBNJ uUG2mWDiaDaB3+6RwFIipOOQHJTRqTON6LUDaJpwKvfRBQEMkZvGrAtGD6WgLingqwOE otP6kW/eO5JI3LL55qxJYcND/dh3A87FpWCg0= Received: by 10.216.238.3 with SMTP id z3mr1182305weq.86.1311289267226; Thu, 21 Jul 2011 16:01:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.180.21 with HTTP; Thu, 21 Jul 2011 16:00:27 -0700 (PDT) In-Reply-To: <4E289FD5.3010806@cs.ucla.edu> References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E289FD5.3010806@cs.ucla.edu> From: Herb Wartens Date: Thu, 21 Jul 2011 16:00:27 -0700 Message-ID: Subject: Re: bug#9141: Coreutils Compiler Warnings on OSX 10.7 (Lion) To: Paul Eggert Content-Type: multipart/alternative; boundary=001517402310f8899f04a89c52ed X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 9141 X-Mailman-Approved-At: Thu, 21 Jul 2011 19:08:31 -0400 Cc: 9141@debbugs.gnu.org, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) --001517402310f8899f04a89c52ed Content-Type: text/plain; charset=ISO-8859-1 On 07/21/11 02:16, Herb Wartens wrote: > > > I have added a hack to get coreutils to compile cleanly on OSX. > > Thanks, but we should fix this problem more cleanly. Does the > following patch to lib/stdint.in.h solve your problem? This fix is > already scheduled to appear in the next version of coreutils. If it > doesn't solve your problem, what are the symptoms of failure? > > I agree. Fixing it more cleanly would definitely be better! The patch I sent was a hack just to get coreutils compiling cleanly. The patch you sent does indeed remove the compiler warnings I was seeing when printing integers with the PRIuMAX and PRIdMAX macros on OSX. I am still seeing the fdatasync warnings though. --001517402310f8899f04a89c52ed Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On 07/21/11 02:16, Herb Wartens wrote:

> I have added a hack to get coreutils to compile cleanly on OSX.

Thanks, but we should fix this problem more cleanly. =A0Does the
following patch to lib/stdint.in.h solve your problem? =A0This fix is
already scheduled to appear in the next version of coreutils. =A0If it
doesn't solve your problem, what are the symptoms of failure?


I agree. =A0Fixing it more cleanly wou= ld definitely be better! =A0The patch I sent was a hack just to get coreuti= ls compiling cleanly. =A0The patch you sent does indeed remove the compiler= warnings I was seeing when printing integers with the=A0PRIuMAX and PRIdMAX macros on OSX. I a= m still seeing the fdatasync warnings though.
--001517402310f8899f04a89c52ed-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 21 19:09:01 2011 Received: (at 9141) by debbugs.gnu.org; 21 Jul 2011 23:09:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk2MX-00051R-2H for submit@debbugs.gnu.org; Thu, 21 Jul 2011 19:09:01 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qk2MU-00051D-Qc for 9141@debbugs.gnu.org; Thu, 21 Jul 2011 19:08:59 -0400 Received: by wwf25 with SMTP id 25so1683579wwf.15 for <9141@debbugs.gnu.org>; Thu, 21 Jul 2011 16:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=NdE+SafAoy0V8alnJDHfC0nNYZP3jvFUwbNXdW0CKig=; b=vaxDybt3gGJA6KPZSuX/mGg/IbAaSE0Z69FzmnKtI4jqT4f8j2ilRmajdIMYuktiQ0 IWZwlFnc1Ysc4CjmhQXpRlwQw0FcQ2sq5sOEWZfr+o8OFXHD3GMR7N6Y8khHuw8nQSvD N6BW+PyHE/dEEEfSm8FMMtRmsSA5YaKFs8tzM= Received: by 10.216.60.4 with SMTP id t4mr605372wec.101.1311289733094; Thu, 21 Jul 2011 16:08:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.180.21 with HTTP; Thu, 21 Jul 2011 16:08:13 -0700 (PDT) In-Reply-To: <4E28A34E.4040107@cs.ucla.edu> References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E28A34E.4040107@cs.ucla.edu> From: Herb Wartens Date: Thu, 21 Jul 2011 16:08:13 -0700 Message-ID: Subject: Re: bug#9141: Coreutils Compiler Warnings on OSX 10.7 (Lion) To: Paul Eggert Content-Type: multipart/alternative; boundary=000e0ce0280ebd1e6204a89c6e9b X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) --000e0ce0280ebd1e6204a89c6e9b Content-Type: text/plain; charset=ISO-8859-1 On Thu, Jul 21, 2011 at 3:08 PM, Paul Eggert wrote: > On 07/21/11 02:16, Herb Wartens wrote: > > OSX does have fdatasync defined as part of the libsystem_kernel.dylib > library. > > The problem is that there is no header on OSX that actually provides the > function. > > Thanks again for reporting this. > > No problem. > What is the exact symptom of failure here? > If 'configure' successfully linked to fdatasync, then > presumably coreutils can link to it too. So presumably > your compiler complained about the missing declaration. > But did it go ahead and use fdatasync anyway? If so, > we're done: you can just ignore the diagnostic. If not, > I prefer to have my code always compile cleanly. I have found that when compiling code that generates a lot of warnings, people tend to ignore them (even important ones). The linker was able to resolve the fdatasync and include it in the binaries: # nm /usr/local/apps/Utils/coreutils/bin/dd | grep fdatasync U _fdatasync # otool -L /usr/local/apps/Utils/coreutils/bin/dd /usr/local/apps/Utils/coreutils/bin/dd: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0) # otool -L /usr/lib/libSystem.B.dylib /usr/lib/libSystem.B.dylib: /usr/lib/system/libsystem_kernel.dylib (compatibility version 1.0.0, current version 1699.22.73) # nm /usr/lib/system/libsystem_kernel.dylib | grep fdatasync 0000000000017430 T _fdatasync > perhaps 'configure' should check that fdatasync is declared > (and not just linkable too), and use fdatasync only if it > is declared; that would be more-conservative. > > It would be more conservative, but we really could use it since we have it defined in a library. Unfortunately Apple did not include a header to define it properly. It's your call though as I would think either way is fine (though some may prefer to actually have the fdatasync functionality). > Have you checked, via "grep -r fdatasync /usr/include/", whether > fdatasync is actually present anywhere? It might be declared only > if some other symbol is #define'd, in which case, we should find > out what that is and #define it. > Yes I have checked, but I will leave you the results so that you candouble-check me...=) > grep -R fdatasync /usr/include /usr/include/pg_config.h:/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you /usr/include/pg_config.h:/* Define to 1 if you have the `fdatasync' function. */ /usr/include/postgresql/internal/c.h:extern int fdatasync(int fildes); /usr/include/postgresql/server/access/xlogdefs.h: * configure determined whether fdatasync() is. /usr/include/postgresql/server/c.h:extern int fdatasync(int fildes); /usr/include/postgresql/server/pg_config.h:/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you /usr/include/postgresql/server/pg_config.h:/* Define to 1 if you have the `fdatasync' function. */ /usr/include/postgresql/server/port/linux.h: * Set the default wal_sync_method to fdatasync. With recent Linux versions, /usr/include/postgresql/server/storage/fd.h:extern int pg_fdatasync(int fd); /usr/include/python2.5/pyconfig.h:/* Define if you have the 'fdatasync' function. */ /usr/include/python2.5/pyport.h:extern int fdatasync(int); /usr/include/python2.6/pyconfig.h:/* Define if you have the 'fdatasync' function. */ /usr/include/python2.6/pyport.h:extern int fdatasync(int); /usr/include/python2.7/pyconfig.h:/* Define if you have the 'fdatasync' function. */ /usr/include/python2.7/pyport.h:extern int fdatasync(int); /usr/include/sys/syscall.h:#define SYS_fdatasync 187 --000e0ce0280ebd1e6204a89c6e9b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Jul 21, 2011 at 3:08 PM, Paul Eg= gert <eggert@cs.= ucla.edu> wrote:
On 07/21/11 02:16, Herb Wartens wrote:
> OSX does have fdatasync defined as part of the libsystem_kernel.= dylib library.
> The problem is that there is no header on OSX that actually provides t= he function.

Thanks again for reporting this.


No problem.

= =A0
What is the exact symptom of failure here?
If 'configure' successfully linked to fdatasync, then
presumably coreutils can link to it too. =A0So presumably
your compiler complained about the missing declaration.
But did it go ahead and use fdatasync anyway? =A0If so,
we're done: you can just ignore the diagnostic. =A0If not,


I prefer to have my code always=A0co= mpile=A0cleanly. =A0I have found that when compiling code that generates a = lot of warnings, people tend to ignore them (even important ones). =A0The l= inker was able to resolve the fdatasync and include it in the binaries:

# nm /usr/local/apps/Utils/coreutils/bin/dd | grep= fdatasync
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0U _fdatasync
<= /div>

# otool -L /usr/local/apps/Utils/coreutils/bi= n/dd =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0
/usr/local/apps/Utils/coreutils/bin/dd:
/usr/lib/libSystem.B.dylib (co= mpatibility version 1.0.0, current version 159.0.0)

# otool -L /usr/lib/libSystem.B.dylib=A0
/usr/lib/libSy= stem.B.dylib:
<snip>
/usr/lib/system/libsystem_kernel.dylib (compat= ibility version 1.0.0, current version 1699.22.73)
</= snip>

# nm /usr/lib/system/libsystem= _kernel.dylib | grep fdatasync
0000000000017430 T _fdatasync

=A0
perhaps 'configure' should check that fdatasync is declared
(and not just linkable too), and use fdatasync only if it
is declared; that would be more-conservative.


It would be more conservative, but we = really could use it since we have it defined in a library. =A0Unfortunately= Apple did not include a header to define it properly. =A0It's your cal= l though as I would think either way is fine (though some may prefer to act= ually have the fdatasync functionality).

=A0
Have you checked, via "grep -r fdatasync /usr/include/", whether<= br> fdatasync is actually present anywhere? =A0It might be declared only
if some other symbol is #define'd, in which case, we should find
out what that is and #define it.


Yes I have checked, but I will leave you the results so that you c= andouble-check me...=3D)
> grep -R fdatasync /usr/include =A0 = =A0 =A0
/usr/include/pg_config.h:/* Define to 1 if you have the declaration of= `fdatasync', and to 0 if you
/usr/include/pg_config.h:/* Def= ine to 1 if you have the `fdatasync' function. */
/usr/includ= e/postgresql/internal/c.h:extern int fdatasync(int fildes);
/usr/include/postgresql/server/access/xlogdefs.h: * configure determin= ed whether fdatasync() is.
/usr/include/postgresql/server/c.h:ext= ern int fda= tasync(int fildes);
/usr/include/postgresql/server/pg_config.h:/* Define to 1 if you have = the declaration of `fdatasync', and to 0 if you
/usr/include/= postgresql/server/pg_config.h:/* Define to 1 if you have the `fdatasync'= ; function. */
/usr/include/postgresql/server/port/linux.h: * Set the default wal_syn= c_method to fdatasync. =A0With recent Linux versions,
/usr/includ= e/postgresql/server/storage/fd.h:extern int pg_fdatasync(int fd);
/usr/include/python2.5/pyconfig.h:/* Define if you have the 'fdata= sync' function. */
/usr/include/python2.5/pyport.h:extern int= fdatasync(int);
/usr/include/python2.6/pyconfig.h:/* Define if y= ou have the 'fdatasync' function. */
/usr/include/python2.6/pyport.h:extern int fdatasync(int);
/= usr/include/python2.7/pyconfig.h:/* Define if you have the 'fdatasync&#= 39; function. */
/usr/include/python2.7/pyport.h:extern int fdata= sync(int);
/usr/include/sys/syscall.h:#define SYS_fdatasync =A0 =A0 =A0187=A0
--000e0ce0280ebd1e6204a89c6e9b-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 13:18:26 2011 Received: (at 9141) by debbugs.gnu.org; 22 Jul 2011 17:18:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkJMn-0006BD-Rz for submit@debbugs.gnu.org; Fri, 22 Jul 2011 13:18:26 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkJMl-0006B2-1L for 9141@debbugs.gnu.org; Fri, 22 Jul 2011 13:18:24 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 89DD739E80FA; Fri, 22 Jul 2011 10:18:17 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ORwALgRS86ip; Fri, 22 Jul 2011 10:18:17 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id F2E6A39E80F0; Fri, 22 Jul 2011 10:18:16 -0700 (PDT) Message-ID: <4E29B0D4.6040003@cs.ucla.edu> Date: Fri, 22 Jul 2011 10:18:12 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 MIME-Version: 1.0 To: Bug-gnulib Subject: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) Recent versions of MacOS seem to have a _DARWIN_C_SOURCE flag that has roughly the same role that _GNU_SOURCE has for GNU systems. I pushed the following patch into gnulib, under the theory that it is more in the line with the usual Autoconf / gnulib philosophy, and it may fix some porting issues. Herb, can you please try configuring coreutils with this change? If you don't have all the autotools installed, you can simply append "#define _DARWIN_C_SOURCE 1" to lib/config.h after running "configure". Thanks. * m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Define _DARWIN_C_SOURCE. --- ChangeLog | 5 +++++ m4/extensions.m4 | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index b22ea11..46d8d04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-22 Paul Eggert + + extensions: Enable extensions on MacOS X 10.5 and later. + * m4/extensions.m4 (AC_USE_SYSTEM_EXTENSIONS): Define _DARWIN_C_SOURCE. + 2011-07-22 Kamil Dudka file-has-acl: use acl_extended_file_nofollow if available diff --git a/m4/extensions.m4 b/m4/extensions.m4 index 1330503..22156e0 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 @@ -1,4 +1,4 @@ -# serial 9 -*- Autoconf -*- +# serial 10 -*- Autoconf -*- # Enable extensions on systems that normally disable them. # Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc. @@ -67,6 +67,10 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif +/* Enable general extensions on MacOS X. */ +#ifndef _DARWIN_C_SOURCE +# undef _DARWIN_C_SOURCE +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE @@ -95,6 +99,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl test $ac_cv_safe_to_define___extensions__ = yes && AC_DEFINE([__EXTENSIONS__]) AC_DEFINE([_ALL_SOURCE]) + AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) AC_DEFINE([_TANDEM_SOURCE]) -- 1.7.4.4 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 16:47:28 2011 Received: (at 9141) by debbugs.gnu.org; 22 Jul 2011 20:47:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkMd6-0003Ra-2R for submit@debbugs.gnu.org; Fri, 22 Jul 2011 16:47:28 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkMd2-0003RO-S4 for 9141@debbugs.gnu.org; Fri, 22 Jul 2011 16:47:25 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 4FEEB39E80FA; Fri, 22 Jul 2011 13:47:19 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NoSe5sjXMQw1; Fri, 22 Jul 2011 13:47:18 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8197839E80E1; Fri, 22 Jul 2011 13:47:18 -0700 (PDT) Message-ID: <4E29E1D6.9030509@cs.ucla.edu> Date: Fri, 22 Jul 2011 13:47:18 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 MIME-Version: 1.0 To: Herb Wartens Subject: Re: bug#9141: Coreutils Compiler Warnings on OSX 10.7 (Lion) References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E289FD5.3010806@cs.ucla.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) On 07/21/11 16:00, Herb Wartens wrote: > I am still seeing the fdatasync > warnings though. I just pushed this patch, which should fix things. Please let me know if it doesn't. Looking around the net, it appears that the fdatasync of Mac OS 10.7 is not effective, so it's better to be safe here and act as if it doesn't exist. >From 339613b6bdd8d4a51435cba9e903b8b5bb082da4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jul 2011 13:40:03 -0700 Subject: [PATCH] dd, shred: use fdatasync only if declared * m4/jm-macros.m4 (coreutils_MACROS): Use fdatasync only if declared. MacOS X 10.7 has an fdatasync that is not declared, and is rumored to be ineffective. (Bug#9141) --- m4/jm-macros.m4 | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4 index 6e97221..58b000d 100644 --- a/m4/jm-macros.m4 +++ b/m4/jm-macros.m4 @@ -93,14 +93,20 @@ AC_DEFUN([coreutils_MACROS], cu_PREREQ_STAT_PROG # for dd.c and shred.c - coreutils_saved_libs=$LIBS - LIB_FDATASYNC= + # + # Use fdatasync only if declared. On MacOS X 10.7, fdatasync exists but + # is not declared, and is ineffective. + LIB_FDATASYNC= + AC_SUBST([LIB_FDATASYNC]) + AC_CHECK_DECLS_ONCE([fdatasync]) + if test $ac_cv_have_decl_fdatasync = yes; then + coreutils_saved_libs=$LIBS AC_SEARCH_LIBS([fdatasync], [rt posix4], [test "$ac_cv_search_fdatasync" = "none required" || LIB_FDATASYNC=$ac_cv_search_fdatasync]) - AC_SUBST([LIB_FDATASYNC]) AC_CHECK_FUNCS([fdatasync]) - LIBS=$coreutils_saved_libs + LIBS=$coreutils_saved_libs + fi # Check whether libcap is usable -- for ls --color support LIB_CAP= -- 1.7.4.4 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 17:13:44 2011 Received: (at 9141) by debbugs.gnu.org; 22 Jul 2011 21:13:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkN2V-000416-4H for submit@debbugs.gnu.org; Fri, 22 Jul 2011 17:13:43 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkN2Q-00040r-IO for 9141@debbugs.gnu.org; Fri, 22 Jul 2011 17:13:41 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id E141A39E80FF; Fri, 22 Jul 2011 14:13:32 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q8Wg2g7DO6ae; Fri, 22 Jul 2011 14:13:30 -0700 (PDT) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 249F039E80FA; Fri, 22 Jul 2011 14:13:30 -0700 (PDT) Message-ID: <4E29E7F9.9040106@cs.ucla.edu> Date: Fri, 22 Jul 2011 14:13:29 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 MIME-Version: 1.0 To: Bug-gnulib Subject: fdatasync module proposal Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) Surely coreutils is not the only program that will have problems with fdatasync on Mac OS. How about the following gnulib patches? One is for fdatasync, the other for its tests. >From d5c4b4b9266db16c8477a94640290e0b662cee93 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jul 2011 14:00:22 -0700 Subject: [PATCH 1/2] fdatasync: New module * MODULES.html.sh: Add it. * doc/posix-functions/fdatasync.texi (fdatasync): Document it. * lib/unistd.in.h (fdatasync): Arrange for replacement. * m4/unistd_h.m4 (gl_UNISTD_H): Prepare for warn-on-use. (gl_UNISTD_H_DEFAULTS): Define defaults for it. * modules/unistd (unistd.h): Substitute for its vars. * lib/fdatasync.c, m4/fdatasync.m4, modules/fdatasync: New files. --- ChangeLog | 9 +++++++++ MODULES.html.sh | 1 + doc/posix-functions/fdatasync.texi | 11 +++++++---- lib/fdatasync.c | 30 ++++++++++++++++++++++++++++++ lib/unistd.in.h | 28 ++++++++++++++++++++++++++++ m4/fdatasync.m4 | 34 ++++++++++++++++++++++++++++++++++ m4/unistd_h.m4 | 6 +++++- modules/fdatasync | 32 ++++++++++++++++++++++++++++++++ modules/unistd | 4 ++++ 9 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 lib/fdatasync.c create mode 100644 m4/fdatasync.m4 create mode 100644 modules/fdatasync diff --git a/ChangeLog b/ChangeLog index b652f25..15b0fe5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2011-07-22 Paul Eggert + fdatasync: New module + * MODULES.html.sh: Add it. + * doc/posix-functions/fdatasync.texi (fdatasync): Document it. + * lib/unistd.in.h (fdatasync): Arrange for replacement. + * m4/unistd_h.m4 (gl_UNISTD_H): Prepare for warn-on-use. + (gl_UNISTD_H_DEFAULTS): Define defaults for it. + * modules/unistd (unistd.h): Substitute for its vars. + * lib/fdatasync.c, m4/fdatasync.m4, modules/fdatasync: New files. + fsusage: port to MacOS X 10.7 with 4 TiB file systems * m4/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Reject statvfs implementations that use only 32 bits to count blocks. diff --git a/MODULES.html.sh b/MODULES.html.sh index 80befa9..a185c42 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -2360,6 +2360,7 @@ func_all_modules () func_module fclose func_module fcntl-h func_module fcntl + func_module fdatasync func_module flock func_module fopen func_module fprintf-posix diff --git a/doc/posix-functions/fdatasync.texi b/doc/posix-functions/fdatasync.texi index 8631207..2c581d8 100644 --- a/doc/posix-functions/fdatasync.texi +++ b/doc/posix-functions/fdatasync.texi @@ -4,15 +4,18 @@ POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html} -Gnulib module: --- +Gnulib module: fdatasync Portability problems fixed by Gnulib: @itemize +@item +This function is present but undeclared and ineffective on some platforms: +MacOS X 10.7 +@item +This function is missing on some platforms: +MacOS X 10.5, FreeBSD 6.0, OpenBSD 3.8, IRIX 5.3, Solaris 2.4, mingw, Interix 3.5, BeOS. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on some platforms: -MacOS X 10.5, FreeBSD 6.0, OpenBSD 3.8, IRIX 5.3, Solaris 2.4, mingw, Interix 3.5, BeOS. @end itemize diff --git a/lib/fdatasync.c b/lib/fdatasync.c new file mode 100644 index 0000000..fbb7b5a --- /dev/null +++ b/lib/fdatasync.c @@ -0,0 +1,30 @@ +/* Emulate fdatasync on platforms that lack it. + + Copyright (C) 2011 Free Software Foundation, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* written by Paul Eggert */ + +#include + +#include + +int +fdatasync (int fd) +#undef fdatasync +{ + /* This isn't right, but it's the best we can do portably. */ + return fsync (fd); +} diff --git a/lib/unistd.in.h b/lib/unistd.in.h index e612fb3..aac5bb2 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -483,6 +483,34 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " #endif +#if @GNULIB_FDATASYNC@ +/* Synchronize data changes to a file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + . */ +# if @REPLACE_FDATASYNC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fdatasync +# define fdatasync rpl_fdatasync +# endif +_GL_FUNCDECL_RPL (fdatasync, int, (int /* fd */)); +_GL_CXXALIAS_RPL (fdatasync, int, (int /* fd */)); +# else +# if !@HAVE_DECL_FDATASYNC@ +_GL_FUNCDECL_SYS (fdatasync, int, (int /* fd */)); +# endif +_GL_CXXALIAS_SYS (fdatasync, int, (int /* fd */)); +# endif +_GL_CXXALIASWARN (fdatasync); +#elif defined GNULIB_POSIXCHECK +# undef fdatasync +# if HAVE_RAW_DECL_FDATASYNC +_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " + "use gnulib module fdatasync for portability"); +# endif +#endif + + #if @GNULIB_FSYNC@ /* Synchronize changes to a file. Return 0 if successful, otherwise -1 and errno set. diff --git a/m4/fdatasync.m4 b/m4/fdatasync.m4 new file mode 100644 index 0000000..af17970 --- /dev/null +++ b/m4/fdatasync.m4 @@ -0,0 +1,34 @@ +# fdatasync.m4 +dnl Copyright 2011 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl written by Paul Eggert + +AC_DEFUN([gl_FUNC_FDATASYNC], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + LIB_FDATASYNC= + AC_SUBST([LIB_FDATASYNC]) + + AC_CHECK_DECLS_ONCE([fdatasync]) + if test $ac_cv_have_decl_fdatasync = no; then + HAVE_DECL_FDATASYNC=0 + + # If it isn't declared, replace it. This is better for MacOS X 10.7, + # where it is not declared, exists, and is ineffective. + REPLACE_FDATASYNC=1 + else + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([fdatasync], [rt posix4], + [test "$ac_cv_search_fdatasync" = "none required" || + LIB_FDATASYNC=$ac_cv_search_fdatasync]) + AC_CHECK_FUNCS([fdatasync]) + LIBS=$gl_saved_libs + if test $ac_cv_func_fdatasync = no; then + HAVE_FDATASYNC=0 + fi + fi +]) diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index fb6fe07..dc6b63e 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -34,7 +34,7 @@ AC_DEFUN([gl_UNISTD_H], # endif #endif ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat - fsync ftruncate getcwd getdomainname getdtablesize getgroups + fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat @@ -61,6 +61,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) + GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC]) GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) @@ -104,6 +105,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) + HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) @@ -128,6 +130,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) + HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) @@ -140,6 +143,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) + REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) diff --git a/modules/fdatasync b/modules/fdatasync new file mode 100644 index 0000000..94980ec --- /dev/null +++ b/modules/fdatasync @@ -0,0 +1,32 @@ +Description: +Synchronize data writes to a file. + +Files: +lib/fdatasync.c +m4/fdatasync.m4 + +Depends-on: +extensions +fsync [test $HAVE_FDATASYNC = 0] +unistd + +configure.ac: +gl_FUNC_FDATASYNC +if test $HAVE_FDATASYNC = 0; then + AC_LIBOBJ([fdatasync]) +fi +gl_UNISTD_MODULE_INDICATOR([fdatasync]) + +Makefile.am: + +Include: + + +Link: +$(LIB_FDATASYNC) + +License: +LGPLv2+ + +Maintainer: +Paul Eggert, Jim Meyering diff --git a/modules/unistd b/modules/unistd index 6c8ea1e..8361608 100644 --- a/modules/unistd +++ b/modules/unistd @@ -38,6 +38,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ @@ -81,6 +82,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ @@ -105,6 +107,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ @@ -118,6 +121,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FDATASYNC''@|$(REPLACE_FDATASYNC)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ -- 1.7.4.4 >From 68da59ddad1456ff7ddc67a66ef605c3a8888da0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 22 Jul 2011 14:02:55 -0700 Subject: [PATCH 2/2] fdatasync-tests: New module * modules/fdatasync-tests, tests/test-fdatasync.c: New files. * tests/test-fsync.c (FSYNC): New macro, to let us test fdatasync. * tests/test-unistd-c++.cc: Add fdatasync test. --- ChangeLog | 5 +++++ modules/fdatasync-tests | 13 +++++++++++++ tests/test-fdatasync.c | 2 ++ tests/test-fsync.c | 10 +++++++--- tests/test-unistd-c++.cc | 4 ++++ 5 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 modules/fdatasync-tests create mode 100644 tests/test-fdatasync.c diff --git a/ChangeLog b/ChangeLog index 15b0fe5..f089c68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-07-22 Paul Eggert + fdatasync-tests: New module + * modules/fdatasync-tests, tests/test-fdatasync.c: New files. + * tests/test-fsync.c (FSYNC): New macro, to let us test fdatasync. + * tests/test-unistd-c++.cc: Add fdatasync test. + fdatasync: New module * MODULES.html.sh: Add it. * doc/posix-functions/fdatasync.texi (fdatasync): Document it. diff --git a/modules/fdatasync-tests b/modules/fdatasync-tests new file mode 100644 index 0000000..3862eda --- /dev/null +++ b/modules/fdatasync-tests @@ -0,0 +1,13 @@ +Files: +tests/test-fdatasync.c +tests/test-fsync.c +tests/signature.h +tests/macros.h + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-fdatasync +check_PROGRAMS += test-fdatasync diff --git a/tests/test-fdatasync.c b/tests/test-fdatasync.c new file mode 100644 index 0000000..90964cc --- /dev/null +++ b/tests/test-fdatasync.c @@ -0,0 +1,2 @@ +#define FSYNC fdatasync +#include "test-fsync.c" diff --git a/tests/test-fsync.c b/tests/test-fsync.c index 2627d0c..6bac01c 100644 --- a/tests/test-fsync.c +++ b/tests/test-fsync.c @@ -18,8 +18,12 @@ #include +#ifndef FSYNC +# define FSYNC fsync +#endif + #include "signature.h" -SIGNATURE_CHECK (fsync, int, (int)); +SIGNATURE_CHECK (FSYNC, int, (int)); #include #include @@ -32,7 +36,7 @@ main (void) int fd; const char *file = "test-fsync.txt"; - if (fsync (0) != 0) + if (FSYNC (0) != 0) { ASSERT (errno == EINVAL /* POSIX */ || errno == ENOTSUP /* seen on MacOS X 10.5 */ @@ -42,7 +46,7 @@ main (void) fd = open (file, O_WRONLY|O_CREAT|O_TRUNC, 0644); ASSERT (0 <= fd); ASSERT (write (fd, "hello", 5) == 5); - ASSERT (fsync (fd) == 0); + ASSERT (FSYNC (fd) == 0); ASSERT (close (fd) == 0); ASSERT (unlink (file) == 0); diff --git a/tests/test-unistd-c++.cc b/tests/test-unistd-c++.cc index 12e415b..fb7425b 100644 --- a/tests/test-unistd-c++.cc +++ b/tests/test-unistd-c++.cc @@ -60,6 +60,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::fchownat, int, (int, char const *, uid_t, gid_t, int)); #endif +#if GNULIB_TEST_FDATASYNC +SIGNATURE_CHECK (GNULIB_NAMESPACE::fdatasync, int, (int)); +#endif + #if GNULIB_TEST_FSYNC SIGNATURE_CHECK (GNULIB_NAMESPACE::fsync, int, (int)); #endif -- 1.7.4.4 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 20:23:59 2011 Received: (at 9141) by debbugs.gnu.org; 23 Jul 2011 00:23:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkQ0c-0001cH-Oa for submit@debbugs.gnu.org; Fri, 22 Jul 2011 20:23:58 -0400 Received: from mo-p00-ob.rzone.de ([81.169.146.161]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkQ0a-0001c0-DG for 9141@debbugs.gnu.org; Fri, 22 Jul 2011 20:23:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311380630; l=673; s=domk; d=haible.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:In-Reply-To: References:Cc:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=9RoucOND81JOTryYOeSaAxwvR98=; b=w8/uLOb222V1Rnw0fVSOgEPMb6QdX5S3jQbcLsjiOsOnmUEWTVVbQTAm+pZK7Bhsgyi elpkkBzPQJx9rxms6JHB8Wslmq4wd6Tq+34FhuV6NJItFCw/hM3Wak0rSHtbe9NKrmMHs abERj9O91cV//0s5ikrDH5uUrCPn1osu978= X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRav445DE8 X-RZG-CLASS-ID: mo00 Received: from linuix.haible.de (dslb-088-068-038-069.pools.arcor-ip.net [88.68.38.69]) by post.strato.de (mrclete mo45) (RZmta 26.2) with ESMTPA id 602ef9n6MNegA5 ; Sat, 23 Jul 2011 02:23:26 +0200 (MEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. Date: Sat, 23 Jul 2011 02:23:47 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) References: <4E29B0D4.6040003@cs.ucla.edu> In-Reply-To: <4E29B0D4.6040003@cs.ucla.edu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107230223.48083.bruno@clisp.org> X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) Paul Eggert wrote: > Recent versions of MacOS seem to have a _DARWIN_C_SOURCE flag that > has roughly the same role that _GNU_SOURCE has for GNU systems. It's not "roughly the same". _GNU_SOURCE makes some symbols visible that are not visible by default. Whereas _DARWIN_C_SOURCE makes some symbols visible that are already visible by default but hidden when _POSIX_C_SOURCE is defined. The usual idiom in the MacOS X header files is #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) So, I expect that your change will be a no-op for almost everyone. Bruno -- In memoriam Dmitry Pavlov From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 22:43:01 2011 Received: (at 9141) by debbugs.gnu.org; 23 Jul 2011 02:43:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkSBB-0004eM-5n for submit@debbugs.gnu.org; Fri, 22 Jul 2011 22:43:01 -0400 Received: from mo-p00-ob.rzone.de ([81.169.146.161]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QkSB7-0004e8-TQ for 9141@debbugs.gnu.org; Fri, 22 Jul 2011 22:42:59 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311388971; l=3773; s=domk; d=haible.de; h=Content-Transfer-Encoding:Content-Type:MIME-Version:In-Reply-To: References:Cc:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=cBCSmC2gnfODpN8bOIH0iQPytyA=; b=Gss0NfTKn8GG8IrZnqc19AXRU1VeOLKSwcq2Qlo+Ss3S/ITX0OYyM1KQFBPFHQ2HOYn Utv9okDVi8PoPCF3LkaiDngS2x1VVS4kaTQ2S6aYqB3AVZxP31+4NGAHWforQYVZtcDQq feK8mQNCJRqSGOJL8mSQnQSMdbwyjshOybM= X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRav445DE8 X-RZG-CLASS-ID: mo00 Received: from linuix.haible.de (dslb-088-068-038-069.pools.arcor-ip.net [88.68.38.69]) by smtp.strato.de (fruni mo45) (RZmta 26.2) with ESMTPA id 600522n6MM6Qpi ; Sat, 23 Jul 2011 04:42:01 +0200 (MEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: fdatasync module proposal Date: Sat, 23 Jul 2011 04:42:23 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) References: <4E29E7F9.9040106@cs.ucla.edu> In-Reply-To: <4E29E7F9.9040106@cs.ucla.edu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107230442.23363.bruno@clisp.org> X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) Hi Paul, > Surely coreutils is not the only program that will have problems > with fdatasync on Mac OS. How about the following gnulib patches? > One is for fdatasync, the other for its tests. Looks mostly good. Just small comments: > --- a/lib/unistd.in.h > +++ b/lib/unistd.in.h > @@ -483,6 +483,34 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " > #endif > > > +#if @GNULIB_FDATASYNC@ > +/* Synchronize data changes to a file. > + Return 0 if successful, otherwise -1 and errno set. > + See POSIX:2001 specification > + . */ POSIX:2001 is superseded by POSIX:2008. Even if the wording in both standards is the same for this function, it is good to encourage people to look at and to refer to the newest standard. So, here I would write See POSIX:2008 specification . */ > diff --git a/m4/fdatasync.m4 b/m4/fdatasync.m4 > new file mode 100644 > index 0000000..af17970 > --- /dev/null > +++ b/m4/fdatasync.m4 > @@ -0,0 +1,34 @@ > ... > + else > + gl_saved_libs=$LIBS > + AC_SEARCH_LIBS([fdatasync], [rt posix4], > + [test "$ac_cv_search_fdatasync" = "none required" || > + LIB_FDATASYNC=$ac_cv_search_fdatasync]) > + AC_CHECK_FUNCS([fdatasync]) > + LIBS=$gl_saved_libs Here one could add a comment like: dnl Solaris <= 2.6 has fdatasync() in libposix4. dnl Solaris 7..10 has it in librt. Just for reference, because in 5 years nobody would remember. > diff --git a/modules/fdatasync b/modules/fdatasync > new file mode 100644 > index 0000000..94980ec > --- /dev/null > +++ b/modules/fdatasync > ... > +fsync [test $HAVE_FDATASYNC = 0] > +unistd > + > +configure.ac: > +gl_FUNC_FDATASYNC > +if test $HAVE_FDATASYNC = 0; then It is safer (w.r.t. future modifications) and more consistent with the hundreds of other modules to also test $REPLACE_FDATASYNC here: [test $HAVE_FDATASYNC = 0 || test $REPLACE_FDATASYNC = 1] > const char *file = "test-fsync.txt"; With this definition, the test-fsync and test-fdatasync programs will write to the same file. That is, when run with "make -j2", they may collide. You need to take a different file name for test-fdatasync. > --- /dev/null > +++ b/tests/test-fdatasync.c > @@ -0,0 +1,2 @@ > +#define FSYNC fdatasync > +#include "test-fsync.c" > diff --git a/tests/test-fsync.c b/tests/test-fsync.c > index 2627d0c..6bac01c 100644 > --- a/tests/test-fsync.c > +++ b/tests/test-fsync.c > @@ -18,8 +18,12 @@ > > #include > > +#ifndef FSYNC > +# define FSYNC fsync > +#endif > + > #include "signature.h" > -SIGNATURE_CHECK (fsync, int, (int)); > +SIGNATURE_CHECK (FSYNC, int, (int)); > > #include > #include > @@ -32,7 +36,7 @@ main (void) > int fd; > const char *file = "test-fsync.txt"; > > - if (fsync (0) != 0) > + if (FSYNC (0) != 0) > { > ASSERT (errno == EINVAL /* POSIX */ > || errno == ENOTSUP /* seen on MacOS X 10.5 */ > @@ -42,7 +46,7 @@ main (void) > fd = open (file, O_WRONLY|O_CREAT|O_TRUNC, 0644); > ASSERT (0 <= fd); > ASSERT (write (fd, "hello", 5) == 5); > - ASSERT (fsync (fd) == 0); > + ASSERT (FSYNC (fd) == 0); > ASSERT (close (fd) == 0); > ASSERT (unlink (file) == 0); > Here, like with test-pselect, I would move everything after the signature test to a separate file, test-fsync.h, that is included by both test-fsync.c and test-fdatasync.c. This avoids #ifdefs (following the general rule to prefer C functions over C macros), and gives freedom to add tests that apply to one of the functions but not both. Bruno -- In memoriam Dmitry Pavlov From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 14:34:14 2011 Received: (at 9141) by debbugs.gnu.org; 23 Jul 2011 18:34:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qkh1h-00021i-OS for submit@debbugs.gnu.org; Sat, 23 Jul 2011 14:34:14 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qkh1f-00021X-SQ for 9141@debbugs.gnu.org; Sat, 23 Jul 2011 14:34:12 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 61CD139E80FA; Sat, 23 Jul 2011 11:34:06 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lKQOvfQzOrCe; Sat, 23 Jul 2011 11:34:05 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B2DC439E80E1; Sat, 23 Jul 2011 11:34:05 -0700 (PDT) Message-ID: <4E2B141D.1040100@cs.ucla.edu> Date: Sat, 23 Jul 2011 11:34:05 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: Bruno Haible Subject: Re: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. References: <4E29B0D4.6040003@cs.ucla.edu> <201107230223.48083.bruno@clisp.org> In-Reply-To: <201107230223.48083.bruno@clisp.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, bug-gnulib@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On 07/22/11 17:23, Bruno Haible wrote: > The usual idiom in the MacOS X header files is > > #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) > > So, I expect that your change will be a no-op for almost everyone. Thanks for the clarification. I looked through what I could glean from Google searches, and found some places that do not use the above pattern. For example, says something like this: int pselect(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, const struct timespec * __restrict, const sigset_t * __restrict) #if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) __DARWIN_EXTSN_C(pselect) #else # if defined(__LP64__) && !__DARWIN_NON_CANCELABLE __DARWIN_1050(pselect) # else __DARWIN_ALIAS_C(pselect) # endif #endif ; and says something like this: #if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH) char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); #else char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath); #endif which suggests that realpath and pselect have "extended" runtime behavior if _DARWIN_C_SOURCE is defined. My guess is that these runtime differences are in the same spirit as _GNU_SOURCE, i.e., they enable desirable changes that POSIX would otherwise prohibit. If so, the patch should be kept. But if these changes are undesirable, the patch should be backed out. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 25 01:59:13 2011 Received: (at 9141) by debbugs.gnu.org; 25 Jul 2011 05:59:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlEC9-0007is-01 for submit@debbugs.gnu.org; Mon, 25 Jul 2011 01:59:13 -0400 Received: from senmx12-mx.siemens-enterprise.com ([62.134.46.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlEC7-0007if-Jm for 9141@debbugs.gnu.org; Mon, 25 Jul 2011 01:59:12 -0400 Received: from MCHP063A.global-ad.net (unknown [172.29.37.61]) by senmx12-mx.siemens-enterprise.com (Server) with ESMTP id 3F5C423F048B; Mon, 25 Jul 2011 07:59:06 +0200 (CEST) Received: from MCHP058A.global-ad.net ([172.29.37.57]) by MCHP063A.global-ad.net ([172.29.37.61]) with mapi; Mon, 25 Jul 2011 07:59:06 +0200 From: "Voelker, Bernhard" To: Paul Eggert , Bug-gnulib Date: Mon, 25 Jul 2011 07:59:04 +0200 Subject: RE: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. Thread-Topic: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. Thread-Index: AcxIk3e65LDHz2P9QCWASx0PkxWbwwB/CvIg Message-ID: <7856072A9D04C24B82DFE2B1112FE38A08FE2D3F36@MCHP058A.global-ad.net> References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E29B0D4.6040003@cs.ucla.edu> In-Reply-To: <4E29B0D4.6040003@cs.ucla.edu> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 9141 Cc: "9141@debbugs.gnu.org" <9141@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Paul Eggert wrote: > diff --git a/m4/extensions.m4 b/m4/extensions.m4 > index 1330503..22156e0 100644 > --- a/m4/extensions.m4 > +++ b/m4/extensions.m4 > @@ -1,4 +1,4 @@ > -# serial 9 -*- Autoconf -*- > +# serial 10 -*- Autoconf -*- > # Enable extensions on systems that normally disable them. > =20 > # Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc. > @@ -67,6 +67,10 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl > #ifndef _ALL_SOURCE > # undef _ALL_SOURCE > #endif > +/* Enable general extensions on MacOS X. */ > +#ifndef _DARWIN_C_SOURCE > +# undef _DARWIN_C_SOURCE > +#endif maybe it's too early in the morning for me ... but isn't this a NOP: "if X is not defined, then undefine it"? Berny From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 25 02:05:49 2011 Received: (at 9141) by debbugs.gnu.org; 25 Jul 2011 06:05:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlEIX-0007t7-F5 for submit@debbugs.gnu.org; Mon, 25 Jul 2011 02:05:49 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlEIV-0007sv-Py for 9141@debbugs.gnu.org; Mon, 25 Jul 2011 02:05:48 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 39DE939E80F2; Sun, 24 Jul 2011 23:05:42 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DMjLKCyD1UW4; Sun, 24 Jul 2011 23:05:41 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 0B61A39E80D2; Sun, 24 Jul 2011 23:05:41 -0700 (PDT) Message-ID: <4E2D07AF.8080007@cs.ucla.edu> Date: Sun, 24 Jul 2011 23:05:35 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: "Voelker, Bernhard" Subject: Re: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E29B0D4.6040003@cs.ucla.edu> <7856072A9D04C24B82DFE2B1112FE38A08FE2D3F36@MCHP058A.global-ad.net> In-Reply-To: <7856072A9D04C24B82DFE2B1112FE38A08FE2D3F36@MCHP058A.global-ad.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 9141 Cc: "9141@debbugs.gnu.org" <9141@debbugs.gnu.org>, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On 07/24/11 22:59, Voelker, Bernhard wrote: >> #ifndef _ALL_SOURCE >> # undef _ALL_SOURCE >> #endif >> +/* Enable general extensions on MacOS X. */ >> +#ifndef _DARWIN_C_SOURCE >> +# undef _DARWIN_C_SOURCE >> +#endif > > maybe it's too early in the morning for me ... but isn't this a NOP: > "if X is not defined, then undefine it"? Later shell magic edits the file to define it. In that sense, it's just like _ALL_SOURCE, which already works. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 25 02:09:43 2011 Received: (at 9141) by debbugs.gnu.org; 25 Jul 2011 06:09:44 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlEMJ-0007yJ-Mq for submit@debbugs.gnu.org; Mon, 25 Jul 2011 02:09:43 -0400 Received: from senmx12-mx.siemens-enterprise.com ([62.134.46.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlEMI-0007y8-0z for 9141@debbugs.gnu.org; Mon, 25 Jul 2011 02:09:42 -0400 Received: from MCHP063A.global-ad.net (unknown [172.29.37.61]) by senmx12-mx.siemens-enterprise.com (Server) with ESMTP id 5C4D723F0427; Mon, 25 Jul 2011 08:09:36 +0200 (CEST) Received: from MCHP058A.global-ad.net ([172.29.37.57]) by MCHP063A.global-ad.net ([172.29.37.61]) with mapi; Mon, 25 Jul 2011 08:09:36 +0200 From: "Voelker, Bernhard" To: Paul Eggert Date: Mon, 25 Jul 2011 08:09:33 +0200 Subject: RE: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. Thread-Topic: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later. Thread-Index: AcxKkOOgLYuUhxY1TrWXiOXezZXGEQAACQhQ Message-ID: <7856072A9D04C24B82DFE2B1112FE38A08FE2D3F42@MCHP058A.global-ad.net> References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E29B0D4.6040003@cs.ucla.edu> <7856072A9D04C24B82DFE2B1112FE38A08FE2D3F36@MCHP058A.global-ad.net> <4E2D07AF.8080007@cs.ucla.edu> In-Reply-To: <4E2D07AF.8080007@cs.ucla.edu> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 9141 Cc: "9141@debbugs.gnu.org" <9141@debbugs.gnu.org>, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.4 (---) Paul Eggert wrote: > On 07/24/11 22:59, Voelker, Bernhard wrote: > >>> #ifndef _ALL_SOURCE >>> # undef _ALL_SOURCE >>> #endif >>> +/* Enable general extensions on MacOS X. */ >>> +#ifndef _DARWIN_C_SOURCE >>> +# undef _DARWIN_C_SOURCE >>> +#endif >>=20 >> maybe it's too early in the morning for me ... but isn't this a NOP: >> "if X is not defined, then undefine it"? > > Later shell magic edits the file to define it. > In that sense, it's just like _ALL_SOURCE, > which already works. Thanks for the clarification. I knew I should get a cup of coffee before hitting the 'send' button. ;-) Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 16 14:33:20 2011 Received: (at 9141) by debbugs.gnu.org; 16 Sep 2011 18:33:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4dE0-0001i4-0X for submit@debbugs.gnu.org; Fri, 16 Sep 2011 14:33:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4dDw-0001hu-Ez for 9141@debbugs.gnu.org; Fri, 16 Sep 2011 14:33:18 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8GISTL3003275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Sep 2011 14:28:29 -0400 Received: from [10.3.113.73] (ovpn-113-73.phx2.redhat.com [10.3.113.73]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8GISSVj032491; Fri, 16 Sep 2011 14:28:29 -0400 Message-ID: <4E73954C.6070404@redhat.com> Date: Fri, 16 Sep 2011 12:28:28 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110831 Fedora/3.1.12-2.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.12 MIME-Version: 1.0 To: Paul Eggert Subject: Re: bug#9141: fdatasync module proposal References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E29E7F9.9040106@cs.ucla.edu> In-Reply-To: <4E29E7F9.9040106@cs.ucla.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) On 07/22/2011 03:13 PM, Paul Eggert wrote: > Surely coreutils is not the only program that will have problems > with fdatasync on Mac OS. How about the following gnulib patches? > > Portability problems fixed by Gnulib: > @itemize > +@item > +This function is present but undeclared and ineffective on some platforms: > +MacOS X 10.7 Do we know this to be the case, or are you just going off of web searches? For example: http://patchwork.ozlabs.org/patch/33954/ "Although the fdatasync function is not referenced in the standard includes (hence the warning), it is present as a syscall: /usr/include/sys/syscall.h:#define SYS_fdatasync 187 Moreover, a fdatasync symbol is available through libSystem" "Compiling just fine doesn't necessarily mean thatt qemu will run fine and do what we want it to do. But in this case it may: i took a look at the XNU sources (I didn't think about this solution first, I forgot it was open source...) and fdatasync appears to be implemented." That is, on MacOS 10.7, must we implement fdatasync via the heavier fsync, or can we merely add the declaration and let the syscall do its job? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 16 15:07:10 2011 Received: (at 9141) by debbugs.gnu.org; 16 Sep 2011 19:07:11 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4dkk-00044L-Nd for submit@debbugs.gnu.org; Fri, 16 Sep 2011 15:07:10 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4dkh-00044C-C3 for 9141@debbugs.gnu.org; Fri, 16 Sep 2011 15:07:08 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id E750A39E80F7; Fri, 16 Sep 2011 12:02:20 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FfE77+QreWB2; Fri, 16 Sep 2011 12:02:20 -0700 (PDT) Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9635739E80DC; Fri, 16 Sep 2011 12:02:20 -0700 (PDT) Message-ID: <4E739D38.1070601@cs.ucla.edu> Date: Fri, 16 Sep 2011 12:02:16 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13 MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#9141: fdatasync module proposal References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E29E7F9.9040106@cs.ucla.edu> <4E73954C.6070404@redhat.com> In-Reply-To: <4E73954C.6070404@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org, Bug-gnulib X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) On 09/16/11 11:28, Eric Blake wrote: > Do we know this to be the case, or are you just going off of web searches? The latter. I just now tried to find that stuff again, and couldn't, so let's just ignore it for now. If the problem turns up again we can fix it later. The whole fsync/fdatasync/O_SYNC/O_DSYNC/F_FULLSYNC/O_DIRECT/etc. business is such a poorly-understood zoo that I'm not sure how much it matters ... From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 15 09:45:55 2018 Received: (at 9141) by debbugs.gnu.org; 15 Oct 2018 13:45:55 +0000 Received: from localhost ([127.0.0.1]:49971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC3Bz-0002ln-EQ for submit@debbugs.gnu.org; Mon, 15 Oct 2018 09:45:55 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:42931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gC3Bx-0002fv-KW; Mon, 15 Oct 2018 09:45:53 -0400 Received: by mail-pg1-f175.google.com with SMTP id i4-v6so9183210pgq.9; Mon, 15 Oct 2018 06:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=n/HznJh0wIZrBJpVI1zR5Uby84dBWlSQOpQsS+TuX/M=; b=pdVW77hYuTOFThhlng7VjbtWtAvCbXAt0fy31Ief5Utbr6VRhIQku6xR4N3b1r8rSs PmWaDwOoGQlTJ1MtxTZGh0t1wiU09qIbIz7cGpdCWwrtdQQfJPUUL3B0+AcRjOOmuqJY lzIFlBYnPu6ef0RevBsEvQNHAnzw7zxz6XUfFAsHHaT8/qLGKEIqMBOTSZMxSBeP3jjG O+pvsIW62oBG6a6vUPN4oLeEBzEyMsmo5Kxi6SQ/cVPlre8004fxA69hgLpcOV9AuaYS icbgadfiCBWEC0SatYSrbinlzDyPT6nBeabVu5vG8T8RboiM+7nBF10Ntgd2A96OTixE KOiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=n/HznJh0wIZrBJpVI1zR5Uby84dBWlSQOpQsS+TuX/M=; b=ihbg2fYDZJJ0aWJFDfswb2AM0V+HsqUY6EbCUS2czBuCAuQNa5e4JE3X8I+qwVGZA2 BIKkuffsmhT3XxbCFNBcCKnIZ0XOqj12CB9rLS+VBZOfOwTTh2FIKMRn+qb/u95SWqwa hVgZsZ6PWwDRDYDEMHYwl9OAJEmbf1MaahFDpMSewNRRaYx3tH+PnxKOPeXRTHx3e8I6 ZBWslf7h0yDGmIyHkkWt0ESPUKXegPMcvs0ZtB6UUnImA/JdjsOuPemeS5TJ0Xu62hbB n67QHDngmXrSdCgFK4Fy8iNhDaliQs7KEl/peo7MGazmxPWeMd07zv4oHUZjH05PrHNb Klhw== X-Gm-Message-State: ABuFfohrNbOB4KqIcXEP68l8UdShPN4YWZ3HPH1lCovjpuAtTdIPxqqI r3QuPU7nYXdX9T9rP6izC7P34TW2i9A= X-Google-Smtp-Source: ACcGV63z/VyC4rqiXLFItpQmFGkDilZxT9ukLyw6tRyOdnqLVK2nfXoikq53lkn2PT6OsQ4IGT10cg== X-Received: by 2002:a62:b87:: with SMTP id 7-v6mr17618797pfl.67.1539611147234; Mon, 15 Oct 2018 06:45:47 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id v83-v6sm22109643pfa.103.2018.10.15.06.45.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 06:45:46 -0700 (PDT) Subject: Re: bug#9141: fdatasync module proposal (WAS: Coreutils Compiler Warnings on OSX 10.7) To: Paul Eggert , Eric Blake References: <84CBDFD8-AFF6-4519-A963-3724F201C6F8@gmail.com> <4E29E7F9.9040106@cs.ucla.edu> <4E73954C.6070404@redhat.com> <4E739D38.1070601@cs.ucla.edu> From: Assaf Gordon Message-ID: <9cacfbb4-b960-ba30-edcc-ba5fcda5acf1@gmail.com> Date: Mon, 15 Oct 2018 07:45:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <4E739D38.1070601@cs.ucla.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 9141 Cc: 9141@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 9141 moreinfo close 9141 stop (Triaging old bugs) On 16/09/11 01:02 PM, Paul Eggert wrote: > On 09/16/11 11:28, Eric Blake wrote: >> Do we know this to be the case, or are you just going off of web searches? > > The latter. I just now tried to find that stuff again, and couldn't, > so let's just ignore it for now. If the problem turns up again > we can fix it later. > > The whole fsync/fdatasync/O_SYNC/O_DSYNC/F_FULLSYNC/O_DIRECT/etc. business is > such a poorly-understood zoo that I'm not sure how much it matters ... > With no further follow-ups in 7 years, I'm closing this bug. regards, - assaf From unknown Sat Aug 16 20:58:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 13 Nov 2018 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator