From unknown Sat Jun 21 10:37:16 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#12968 <12968@debbugs.gnu.org> To: bug#12968 <12968@debbugs.gnu.org> Subject: Status: Assume POSIX 1003.1-1988 or later for errno.h. Reply-To: bug#12968 <12968@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:37:16 +0000 retitle 12968 Assume POSIX 1003.1-1988 or later for errno.h. reassign 12968 emacs submitter 12968 Paul Eggert severity 12968 normal tag 12968 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 23 04:06:38 2012 Received: (at submit) by debbugs.gnu.org; 23 Nov 2012 09:06:38 +0000 Received: from localhost ([127.0.0.1]:34062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpDW-00079j-32 for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:06:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39611) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpDL-00079J-L7 for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:06:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbpBu-0007ny-B4 for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:04:58 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:33822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbpBu-0007nu-7h for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:04:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbpBp-0007TE-9w for bug-gnu-emacs@gnu.org; Fri, 23 Nov 2012 04:04:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbpBg-0007lD-OG for bug-gnu-emacs@gnu.org; Fri, 23 Nov 2012 04:04:49 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:34347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbpBg-0007kG-Cx for bug-gnu-emacs@gnu.org; Fri, 23 Nov 2012 04:04:40 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 402FFA6001E for ; Fri, 23 Nov 2012 01:04:32 -0800 (PST) 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 wNFjQ36Co0Rg for ; Fri, 23 Nov 2012 01:04:27 -0800 (PST) Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 49F01A60008 for ; Fri, 23 Nov 2012 01:04:27 -0800 (PST) Message-ID: <50AF3C1B.7040105@cs.ucla.edu> Date: Fri, 23 Nov 2012 01:04:27 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: Assume POSIX 1003.1-1988 or later for errno.h. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -6.2 (------) Here's a patch to simplify Emacs by assuming POSIX 1003.1-1988 or later for errno.h, which I plan to install soon. This should be safe as other parts of Emacs are already assuming the relevant macros. I haven't tested this on Microsoft platforms though. === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2012-11-23 08:28:06 +0000 +++ lib-src/ChangeLog 2012-11-23 08:56:17 +0000 @@ -1,5 +1,8 @@ 2012-11-23 Paul Eggert + Assume POSIX 1003.1-1988 or later for errno.h. + * movemail.c (main): Assume EAGAIN and EBUSY. + movemail: treat EACCES etc. failures as permanent * movemail.c (main): Treat any link failure other than EEXIST as a permanent failure, not just EPERM. EACCES, for example. === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2012-11-23 08:28:06 +0000 +++ lib-src/movemail.c 2012-11-23 08:56:17 +0000 @@ -430,22 +430,10 @@ for certain failure codes. */ if (status < 0) { - if (++lockcount <= 5) + if (++lockcount <= 5 && (errno == EAGAIN || errno == EBUSY)) { -#ifdef EAGAIN - if (errno == EAGAIN) - { - sleep (1); - goto retry_lock; - } -#endif -#ifdef EBUSY - if (errno == EBUSY) - { - sleep (1); - goto retry_lock; - } -#endif + sleep (1); + goto retry_lock; } pfatal_with_name (inname); === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-23 08:47:34 +0000 +++ src/ChangeLog 2012-11-23 08:59:17 +0000 @@ -1,3 +1,16 @@ +2012-11-23 Paul Eggert + + Assume POSIX 1003.1-1988 or later for errno.h. + * dired.c (directory_files_internal, file_name_completion): + Assume EAGAIN and EINTR are defined. + * fileio.c (Fcopy_file): Assume EISDIR is defined. + * gmalloc.c (ENOMEM, EINVAL): Assume they're defined. + * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined. + * lread.c (readbyte_from_file): Assume EINTR is defined. + * process.c (wait_reading_process_output, send_process) [subprocesses]: + Assume EIO and EAGAIN are defined. + * unexcoff.c (write_segment): Assume EFAULT is defined. + 2012-11-23 Eli Zaretskii * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead === modified file 'src/dired.c' --- src/dired.c 2012-11-23 07:48:43 +0000 +++ src/dired.c 2012-11-23 08:56:17 +0000 @@ -193,19 +193,15 @@ errno = 0; dp = readdir (d); - - if (dp == NULL && (0 -#ifdef EAGAIN - || errno == EAGAIN -#endif -#ifdef EINTR - || errno == EINTR -#endif - )) - { QUIT; continue; } - - if (dp == NULL) - break; + if (!dp) + { + if (errno == EAGAIN || errno == EINTR) + { + QUIT; + continue; + } + break; + } len = dirent_namelen (dp); name = finalname = make_unibyte_string (dp->d_name, len); @@ -480,17 +476,15 @@ errno = 0; dp = readdir (d); - if (dp == NULL && (0 -# ifdef EAGAIN - || errno == EAGAIN -# endif -# ifdef EINTR - || errno == EINTR -# endif - )) - { QUIT; continue; } - - if (!dp) break; + if (!dp) + { + if (errno == EAGAIN || errno == EINTR) + { + QUIT; + continue; + } + break; + } len = dirent_namelen (dp); === modified file 'src/fileio.c' --- src/fileio.c 2012-11-21 21:06:52 +0000 +++ src/fileio.c 2012-11-23 08:56:17 +0000 @@ -1995,10 +1995,8 @@ { if (!(S_ISREG (st.st_mode)) && !(S_ISLNK (st.st_mode))) { -#if defined (EISDIR) /* Get a better looking error message. */ errno = EISDIR; -#endif /* EISDIR */ report_file_error ("Non-regular file", Fcons (file, Qnil)); } } === modified file 'src/gmalloc.c' --- src/gmalloc.c 2012-10-01 06:36:54 +0000 +++ src/gmalloc.c 2012-11-23 08:56:17 +0000 @@ -1645,14 +1645,6 @@ return result; } -#ifndef ENOMEM -#define ENOMEM 12 -#endif - -#ifndef EINVAL -#define EINVAL 22 -#endif - int posix_memalign (void **memptr, size_t alignment, size_t size) { === modified file 'src/gnutls.c' --- src/gnutls.c 2012-09-23 19:36:31 +0000 +++ src/gnutls.c 2012-11-23 08:56:17 +0000 @@ -359,12 +359,7 @@ if (proc->gnutls_initstage != GNUTLS_STAGE_READY) { -#ifdef EWOULDBLOCK - errno = EWOULDBLOCK; -#endif -#ifdef EAGAIN errno = EAGAIN; -#endif return 0; } @@ -384,14 +379,7 @@ appropriately so that send_process retries the correct way instead of erroring out. */ if (rtnval == GNUTLS_E_AGAIN) - { -#ifdef EWOULDBLOCK - errno = EWOULDBLOCK; -#endif -#ifdef EAGAIN - errno = EAGAIN; -#endif - } + errno = EAGAIN; break; } } === modified file 'src/keyboard.c' --- src/keyboard.c 2012-11-17 22:12:47 +0000 +++ src/keyboard.c 2012-11-23 08:56:17 +0000 @@ -6986,10 +6986,7 @@ an EAGAIN error. Does anybody know of a situation where a retry is actually needed? */ #if 0 - nread < 0 && (errno == EAGAIN -#ifdef EFAULT - || errno == EFAULT -#endif + nread < 0 && (errno == EAGAIN || errno == EFAULT #ifdef EBADSLT || errno == EBADSLT #endif === modified file 'src/lread.c' --- src/lread.c 2012-11-20 20:06:17 +0000 +++ src/lread.c 2012-11-23 08:56:17 +0000 @@ -440,7 +440,6 @@ block_input (); c = getc (instream); -#ifdef EINTR /* Interrupted reads have been observed while reading over the network. */ while (c == EOF && ferror (instream) && errno == EINTR) { @@ -450,7 +449,6 @@ clearerr (instream); c = getc (instream); } -#endif unblock_input (); === modified file 'src/process.c' --- src/process.c 2012-11-17 22:12:47 +0000 +++ src/process.c 2012-11-23 08:56:17 +0000 @@ -4432,14 +4432,8 @@ total_nread += nread; got_some_input = 1; } -#ifdef EIO - else if (nread == -1 && EIO == errno) - break; -#endif -#ifdef EAGAIN - else if (nread == -1 && EAGAIN == errno) - break; -#endif + else if (nread == -1 && (errno == EIO || errno == EAGAIN)) + break; #ifdef EWOULDBLOCK else if (nread == -1 && EWOULDBLOCK == errno) break; @@ -5517,13 +5511,10 @@ if (rv < 0) { - if (0 + if (errno == EAGAIN #ifdef EWOULDBLOCK || errno == EWOULDBLOCK #endif -#ifdef EAGAIN - || errno == EAGAIN -#endif ) /* Buffer is full. Wait, accepting input; that may allow the program === modified file 'src/unexcoff.c' --- src/unexcoff.c 2012-09-15 07:06:56 +0000 +++ src/unexcoff.c 2012-11-23 08:56:17 +0000 @@ -332,11 +332,7 @@ a gap between the old text segment and the old data segment. This gap has probably been remapped into part of the text segment. So write zeros for it. */ - if (ret == -1 -#ifdef EFAULT - && errno == EFAULT -#endif - ) + if (ret == -1 && errno == EFAULT) { /* Write only a page of zeros at once, so that we don't overshoot the start From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 23 04:08:55 2012 Received: (at control) by debbugs.gnu.org; 23 Nov 2012 09:08:55 +0000 Received: from localhost ([127.0.0.1]:34075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpFn-0007DJ-0V for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:08:55 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:50026) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbpFl-0007DA-D4 for control@debbugs.gnu.org; Fri, 23 Nov 2012 04:08:54 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id AC5E0A60008 for ; Fri, 23 Nov 2012 01:07:27 -0800 (PST) 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 bA-HbwrN3FK8 for ; Fri, 23 Nov 2012 01:07:27 -0800 (PST) Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5CD8BA6001F for ; Fri, 23 Nov 2012 01:07:27 -0800 (PST) Message-ID: <50AF3CD0.4020309@cs.ucla.edu> Date: Fri, 23 Nov 2012 01:07:28 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: 12968 has a patch Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -1.9 (-) tags 12968 patch From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 23 04:40:07 2012 Received: (at 12968) by debbugs.gnu.org; 23 Nov 2012 09:40:07 +0000 Received: from localhost ([127.0.0.1]:34125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tbpjt-0000gK-V8 for submit@debbugs.gnu.org; Fri, 23 Nov 2012 04:40:05 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:48940) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tbpjo-0000fn-4i for 12968@debbugs.gnu.org; Fri, 23 Nov 2012 04:40:00 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MDX00N00OYU1S00@a-mtaout22.012.net.il> for 12968@debbugs.gnu.org; Fri, 23 Nov 2012 11:38:29 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDX00M7GPG5TB70@a-mtaout22.012.net.il>; Fri, 23 Nov 2012 11:38:29 +0200 (IST) Date: Fri, 23 Nov 2012 11:38:30 +0200 From: Eli Zaretskii Subject: Re: bug#12968: Assume POSIX 1003.1-1988 or later for errno.h. In-reply-to: <50AF3C1B.7040105@cs.ucla.edu> X-012-Sender: halo1@inter.net.il To: Paul Eggert Message-id: <83mwy8u0a1.fsf@gnu.org> References: <50AF3C1B.7040105@cs.ucla.edu> X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Date: Fri, 23 Nov 2012 01:04:27 -0800 > From: Paul Eggert > > Here's a patch to simplify Emacs by assuming > POSIX 1003.1-1988 or later for errno.h, which I plan > to install soon. This should be safe as other parts of Emacs > are already assuming the relevant macros. I haven't tested > this on Microsoft platforms though. [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.179.55.172 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4995] X-Debbugs-Envelope-To: 12968 Cc: 12968@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii 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: 0.7 (/) > Date: Fri, 23 Nov 2012 01:04:27 -0800 > From: Paul Eggert > > Here's a patch to simplify Emacs by assuming > POSIX 1003.1-1988 or later for errno.h, which I plan > to install soon. This should be safe as other parts of Emacs > are already assuming the relevant macros. I haven't tested > this on Microsoft platforms though. Looks OK for MS-Windows, all the referenced errno values are defined in errno.h. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 27 00:19:31 2012 Received: (at 12968-done) by debbugs.gnu.org; 27 Nov 2012 05:19:32 +0000 Received: from localhost ([127.0.0.1]:40859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdDZz-0003il-J6 for submit@debbugs.gnu.org; Tue, 27 Nov 2012 00:19:31 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:52834) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdDZw-0003ia-Q4 for 12968-done@debbugs.gnu.org; Tue, 27 Nov 2012 00:19:30 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 8E3ADA60003; Mon, 26 Nov 2012 21:17:41 -0800 (PST) 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 0oZ-HMQb0AyZ; Mon, 26 Nov 2012 21:17:41 -0800 (PST) Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2DB8DA60001; Mon, 26 Nov 2012 21:17:41 -0800 (PST) Message-ID: <50B44CF6.1020605@cs.ucla.edu> Date: Mon, 26 Nov 2012 21:17:42 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12968: Assume POSIX 1003.1-1988 or later for errno.h. References: <50AF3C1B.7040105@cs.ucla.edu> <83mwy8u0a1.fsf@gnu.org> In-Reply-To: <83mwy8u0a1.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12968-done Cc: 12968-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -1.9 (-) On 11/23/2012 01:38 AM, Eli Zaretskii wrote: > Looks OK for MS-Windows, all the referenced errno values are defined > in errno.h. Thanks for the review, I committed the patch as trunk bzr 111016. From unknown Sat Jun 21 10:37:16 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, 25 Dec 2012 12:24:03 +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