wasm-demo/demo/ermis-f/python_m/cur/1473

44 lines
1.5 KiB
Plaintext

From: guido at CNRI.Reston.VA.US (Guido van Rossum)
Date: Sat, 03 Apr 1999 08:11:40 -0500
Subject: fix for posix_fsync under SunOS 4.1.x
In-Reply-To: Your message of "Sat, 03 Apr 1999 07:29:50 GMT."
<199904030729.XAA24695@igce.igc.org>
References: <199904030729.XAA24695@igce.igc.org>
Message-ID: <199904031311.IAA11599@eric.cnri.reston.va.us>
Content-Length: 1043
X-UID: 1473
> Here's a patch to make sure that posix_fsync will compile on all operating
> systems (specifically needed for SunOS 4.1.x).
>
> This unified diff was made against Python 1.5.2 beta 2 .
>
> -scott
>
> --- Modules/posixmodule.c~ Tue Feb 16 11:38:04 1999
> +++ Modules/posixmodule.c Fri Apr 2 22:18:03 1999
> @@ -647,6 +647,8 @@
> "fsync(fildes) -> None\n\
> force write of file with filedescriptor to disk.";
>
> +extern int fsync(int); /* Prototype just in case */
> +
> static PyObject *
> posix_fsync(self, args)
> PyObject *self;
On how many other operating systems have you tried this patch? I have
found that almost invariably when you use an extern declaration of a
standard function that is defined in the system headers on most modern
systems, there's at least one system out there where what they have in
the headers causes a conflict with what you declare! It would be
better if you put it insude an #ifdef specific for the SunOS 4.x
platform.
--Guido van Rossum (home page: http://www.python.org/~guido/)