From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12945: Assume POSIX 1003.1-1988 or later for unistd.h. Date: Wed, 21 Nov 2012 05:40:30 +0200 Message-ID: <83wqxfvd1t.fsf@gnu.org> References: <50ABC017.7060802@cs.ucla.edu> <83fw44w38g.fsf@gnu.org> <833904vxqo.fsf@gnu.org> <50ABED34.7040307@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1353469314 10394 80.91.229.3 (21 Nov 2012 03:41:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2012 03:41:54 +0000 (UTC) Cc: 12945@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 21 04:42:05 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tb1CO-00028z-NW for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Nov 2012 04:42:04 +0100 Original-Received: from localhost ([::1]:56763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb1CE-0001av-AQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Nov 2012 22:41:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb1CB-0001ae-Ao for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2012 22:41:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tb1CA-0007Ut-Ao for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2012 22:41:51 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb1CA-0007Up-7h for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2012 22:41:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tb1DK-0004p6-Ef for bug-gnu-emacs@gnu.org; Tue, 20 Nov 2012 22:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Nov 2012 03:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12945 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12945-submit@debbugs.gnu.org id=B12945.135346932718475 (code B ref 12945); Wed, 21 Nov 2012 03:43:02 +0000 Original-Received: (at 12945) by debbugs.gnu.org; 21 Nov 2012 03:42:07 +0000 Original-Received: from localhost ([127.0.0.1]:57635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tb1CQ-0004nv-Jf for submit@debbugs.gnu.org; Tue, 20 Nov 2012 22:42:07 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:61319) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tb1CN-0004nT-9B for 12945@debbugs.gnu.org; Tue, 20 Nov 2012 22:42:04 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MDT00C00JCM2R00@a-mtaout22.012.net.il> for 12945@debbugs.gnu.org; Wed, 21 Nov 2012 05:40:48 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MDT00B4FJK0X790@a-mtaout22.012.net.il>; Wed, 21 Nov 2012 05:40:48 +0200 (IST) In-reply-to: <50ABED34.7040307@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:67257 Archived-At: > Date: Tue, 20 Nov 2012 12:51:00 -0800 > From: Paul Eggert > CC: 12945@debbugs.gnu.org > > > Here's the patch for that: > > Thanks. Won't we need patches elswhere to match? Some, but not all. See below. > Also, how is this related to the "#define getcwd _getcwd" in > lib-src/ntlib.h? We might need that for MSVC. But that's a different issue, since lib-src programs don't use any code in w32.c. > --- nt/config.nt 2012-11-17 23:58:56 +0000 > +++ nt/config.nt 2012-11-20 20:44:17 +0000 > @@ -411,11 +411,10 @@ > /* Define to 1 if you have the `getaddrinfo' function. */ > #undef HAVE_GETADDRINFO > > -/* Define to 1 if you have the `getcwd' function. > - If you think about defining HAVE_GETCWD, don't: the alternative > - getwd is redefined on w32.c, and does not really return the current > +/* Define to 1 if you have the `getcwd' function. This is > + defined on w32.c, and does not really return the current > directory, to get the desired results elsewhere in Emacs. */ > -#undef HAVE_GETCWD > +#define HAVE_GETCWD 1 This should be removed entirely, since there are no HAVE_GETCWD tests anymore, right? > === modified file 'src/msdos.c' > --- src/msdos.c 2012-11-05 03:18:32 +0000 > +++ src/msdos.c 2012-11-20 20:44:17 +0000 > @@ -3784,7 +3784,7 @@ > Lisp_Object cmd; > > /* Get current directory as MSDOS cwd is not per-process. */ > - getwd (oldwd); > + getcwd (oldwd, sizeof oldwd); MSDOS is unrelated. This can be changed or left alone. > --- src/sysdep.c 2012-11-20 17:33:00 +0000 > +++ src/sysdep.c 2012-11-20 20:44:17 +0000 > @@ -101,7 +101,6 @@ > #define _P_WAIT 0 > int _cdecl _spawnlp (int, const char *, const char *, ...); > int _cdecl _getpid (void); > -extern char *getwd (char *); > #endif > > #include "syssignal.h" > @@ -504,7 +503,7 @@ > const char *sh = 0; > > #ifdef DOS_NT /* MW, Aug 1993 */ > - getwd (oldwd); > + getcwd (oldwd, sizeof oldwd); > if (sh == 0) > sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */ > #endif This is needed. > === modified file 'src/w32.h' > --- src/w32.h 2012-10-17 19:02:44 +0000 > +++ src/w32.h 2012-11-20 20:44:17 +0000 > @@ -163,7 +163,7 @@ > extern void register_child (int, int); > > extern void sys_sleep (int); > -extern char *getwd (char *); > +extern char *getcwd (char *, size_t); > extern int sys_link (const char *, const char *); This isn't needed; the prototype for getcwd is on a system header. The prototype for getwd should be removed.