This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: libjava/java/io/natFileDescriptorPosix.cc -r1.25 -r1.26
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: toa at pop dot agri dot ch
- Cc: java-patches at gcc dot gnu dot org, konqueror at gmx dot de
- Date: Fri, 16 May 2003 03:42:03 -0500 (CDT)
- Subject: Re: libjava/java/io/natFileDescriptorPosix.cc -r1.25 -r1.26
- References: <200305160337.h4G3bi94068078@latour.rsch.comm.mot.com> <3EC462FC.10607@pop.agri.ch>
- Reply-to: rittle at labs dot mot dot com
In article <3EC462FC.10607@pop.agri.ch>,
Andreas Tobler<toa@pop.agri.ch> writes:
> I have this one for darwin, it may also be valid for *BSD?
> Not reg tested yet.
(Here is the other half, that Andreas and now I'd have in mind.)
Thanks Andreas, how about more generally [so that we need not update
it for every system as we (a) find them; (b) they begin to support the
new finer grain flags. I suspect that both FreeBSD and Darwin system
headers will support those newer POSIX flags at some point.
E.g. there is an explicit comment on the matter in FreeBSD 5's header.]
In the alternative (i.e. if people think this is too gross) or perhaps
in addition to this patch (if there is a system that fail to provide
O_FSYNC as well), the point of use needs to be wrapped and an
exception thrown to signal the lack of real support. BTW, I think I
agree that this is a correct mapping in terms of what O_FSYNC implies
when present on a system. I can confirm the version as posted
completes bootstrap.
* libjava/include/posix.h (O_SYNC): Define if not available
and a reasonable, perhaps more conservative, replacement exists.
(O_DSYNC): Likewise.
Index: libjava/include/posix.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix.h,v
retrieving revision 1.18
diff -c -r1.18 posix.h
*** libjava/include/posix.h 22 Mar 2003 10:56:44 -0000 1.18
--- libjava/include/posix.h 16 May 2003 06:01:26 -0000
***************
*** 48,53 ****
--- 48,62 ----
#define _Jv_platform_solib_suffix ".so"
#endif
+ // Some POSIX systems don't have O_SYNC and O_DYSNC so we define them here.
+ // Needed in java/io/natFileDescriptorPosix.cc.
+ #if !defined (O_SYNC) && defined (O_FSYNC)
+ #define O_SYNC O_FSYNC
+ #endif
+ #if !defined (O_DSYNC) && defined (O_FSYNC)
+ #define O_DSYNC O_FSYNC
+ #endif
+
// Separator for file name components.
#define _Jv_platform_file_separator ((jchar) '/')
// Separator for path components.