aboutsummaryrefslogtreecommitdiff
path: root/libjava/posix.cc
AgeCommit message (Collapse)AuthorFilesLines
2007-02-22re PR libgcj/17002 (java.util.TimeZone.getDefault() is broken)Jakub Jelinek1-0/+4
libjava/ PR libgcj/17002 PR classpath/28550 * java/util/VMTimeZone.java (getDefaultTimeZoneId): To read /etc/localtime, use ZoneInfo.readTZFile instead of VMTimeZone.readtzFile. Get better timezone name for /etc/localtime, either if it is a symlink or through /etc/sysconfig/clock. (readSysconfigClockFile): New static method. (readtzFile): Removed. * java/lang/System.java: Add gnu.java.util.zoneinfo.dir to comments. * posix.cc (_Jv_platform_initProperties): Set gnu.java.util.zoneinfo.dir. * sources.am (gnu_java_util_source_files): Add classpath/gnu/java/util/ZoneInfo.java. * Makefile.in: Regenerated. * java/util/VMTimeZone.h: Regenerated. * java/util/TimeZone.h: Regenerated. * gnu/java/util/ZoneInfo.h: Generated. libjava/classpath/ * java/util/Date.java (parse): Properly parse 09:01:02 as hours/minutes/seconds, not as hours/minutes/year. * java/util/SimpleTimeZone.java (SimpleTimeZone): Simplify {start,end}TimeMode constructor by calling shorter constructor, set {start,end}TimeMode fields after it returns. (setStartRule): Don't adjust startTime into WALL_TIME. Set startTimeMode to WALL_TIME. (endStartRule): Similarly. (getOffset): Handle properly millis + dstOffset overflowing into the next day. Adjust startTime resp. endTime based on startTimeMode resp. endTimeMode. * java/util/TimeZone.java (zoneinfo_dir, availableIDs, aliases0): New static fields. (timezones): Remove synchronized keyword. Set zoneinfo_dir. If non-null, set up aliases0 and don't put anything into timezones0. (defaultZone): Call getTimeZone instead of timezones().get. (getDefaultTimeZone): Fix parsing of EST5 or EST5EDT6. Use getTimeZoneInternal instead of timezones().get. (parseTime): Parse correctly hour:minute. (getTimeZoneInternal): New private method. (getTimeZone): Do the custom ID checking first, canonicalize ID for custom IDs as required by documentation. Call getTimeZoneInternal to handle the rest. (getAvailableIDs(int)): Add locking. Handle zoneinfo_dir != null. (getAvailableIDs(File,String,ArrayList)): New private method. (getAvailableIDs()): Add locking. Handle zoneinfo_dir != null. * gnu/java/util/ZoneInfo.java: New file. From-SVN: r122229
2006-09-14posix.cc (_Jv_platform_nanotime): Return nanoseconds, not microseconds; use ↵Geoffrey Keating1-2/+10
gettimeofday when available. * posix.cc (_Jv_platform_nanotime): Return nanoseconds, not microseconds; use gettimeofday when available. * posix-threads.cc (_Jv_CondWait): Improve accuracy and range of timeout calculation. * testsuite/libjava.lang/Thread_Sleep_2.java: New. * testsuite/libjava.lang/Thread_Sleep_2.out: New. * testsuite/libjava.lang/Thread_Sleep_2.xfail: New. From-SVN: r116941
2006-07-04re PR libgcj/28226 (posix.cc:222: error: invalid conversion from 'const ↵Andreas Tobler1-1/+1
void*' to 'void*') 2006-07-04 Andreas Tobler <a.tobler@schweiz.ch> PR libgcj/28226: * include/posix.h (_Jv_platform_dladdr): Remove const qualifier. * include/win32.h (_Jv_platform_dladdr): Likewise. * posix.cc (_Jv_platform_dladdr): Likewise. * win32.cc (_Jv_platform_dladdr): Likewise. From-SVN: r115184
2006-06-29javaprims.h (_Jv_uintptr_t): New typedef similar to uintptr_t in C99.Ranjit Mathew1-0/+33
* gcj/javaprims.h (_Jv_uintptr_t): New typedef similar to uintptr_t in C99. * include/java-stack.h: Include stdlib.h. (_Jv_AddrInfo): New structure to hold address information. * include/posix.h (_Jv_platform_dladdr): Declare. * include/win32.h (_Jv_platform_dladdr): Declare. (backtrace): Remove declaration. * posix.cc: Include dlfcn.h if available. Include java-stack.h. (_Jv_platform_dladdr): Define. * win32.cc: Include string.h. Include java-stack.h. (backtrace): Remove. (_Jv_platform_dladdr): Define. * sysdep/i386/backtrace.h (fallback_backtrace): Check that a potential frame pointer value is 32-bit word-aligned. Use operand of the CALL instruction calling the current function to find its starting address. * stacktrace.cc: Do not include dlfcn.h. Include platform.h. (_Jv_StackTrace::getLineNumberForFrame): Use _Jv_platform_dladdr() instead of dladdr(). (_Jv_StackTrace::GetStackTraceElements): Use nCodeMap even for Windows. (_Jv_StackTrace::GetClassContext): Use fallback_backtrace() for targets with SJLJ exceptions instead of using _Unwind_Backtrace(). (_Jv_StackTrace::GetFirstNonSystemClassLoader): Likewise. From-SVN: r115069
2006-03-31posix.cc (_Jv_platform_nanotime): Declare id with clockid_t.Andreas Tobler1-1/+1
2006-03-31 Andreas Tobler <a.tobler@schweiz.ch> * posix.cc (_Jv_platform_nanotime): Declare id with clockid_t. From-SVN: r112587
2006-03-29posix.cc (_Jv_platform_nanotime): Look for CLOCK_MONOTONIC and CLOCK_HIGHRES.Tom Tromey1-1/+9
* posix.cc (_Jv_platform_nanotime): Look for CLOCK_MONOTONIC and CLOCK_HIGHRES. From-SVN: r112494
2006-03-09win32.cc (_Jv_platform_nanotime): New function.Tom Tromey1-1/+17
* win32.cc (_Jv_platform_nanotime): New function. * include/win32.h (_Jv_platform_nanotime): Declare. * posix.cc (_Jv_platform_nanotime): New function. * include/posix.h (_Jv_platform_nanotime): Declare. * java/lang/natSystem.cc (nanoTime): New method. * java/lang/System.java (nanoTime): Declare. * include/config.h.in, configure: Rebuilt. * configure.ac: Check for clock_gettime. From-SVN: r111869
2006-02-09re PR libgcj/25187 (dereferencing type-punned pointer warnings while ↵Bryce McKinlay1-1/+1
building libgcj) 2006-02-08 Bryce McKinlay <mckinlay@redhat.com> PR libgcj/25187: * gnu/gcj/io/natSimpleSHSStream.cc (gnu::gcj::io::SimpleSHSStream::shsFinal): Remove bogus cast. * interpret.cc (_Jv_InterpMethod::run): Simplify arguments to _Jv_InterpFrame(). * boehm.cc: #undef some autoconf macros before including gc-config.h. (_Jv_MarkObject): Don't mark the class, it is reachable via the vtable. (_Jv_MarkArray): Likewise. * java/lang/ref/natReference.cc (java::lang::ref::Reference::create): Simplify _Jv_GCRegisterDisappearingLink() call. * java/lang/Class.h (getComponentType): Use element_type. (element_type): New field declaration, as a union with "methods". * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Use "element_type". * java/net/natVMNetworkInterfacePosix.cc (java::net::VMNetworkInterface::getInterfaces): Add "int" cast to avoid sign comparison warning. * include/java-interp.h (_Jv_InterpFrame): Take thread as second argument, not parent call frame. * include/x86_64-signal.h (MAKE_THROW_FRAME): Use "gregs" directly, without a cast. (restore_rt): Declare with hidden visibility, not "static". * posix.cc (_Jv_platform_initProperties): Make "tmpdir" a string constant. * jni.cc (_Jv_JNI_DestroyJavaVM): Use a union to avoid strict alias warning From-SVN: r110783
2003-07-08posix.cc: added #include<stdio.h>Adam Megacz1-0/+1
2003-07-07 Adam Megacz <adam@xwt.org> * posix.cc: added #include<stdio.h> From-SVN: r69066
2003-04-25jvm.h: (_Jv_GetNbArgs) added (_Jv_GetSafeArg) added (_Jv_SetArgs) addedMohan Embar1-4/+1
2003-03-29 Mohan Embar <gnustuff@thisiscool.com> * include/jvm.h: (_Jv_GetNbArgs) added (_Jv_GetSafeArg) added (_Jv_SetArgs) added * prims.cc: (_Jv_GetNbArgs) implemented (_Jv_GetSafeArg) implemented (_Jv_SetArgs) implemented (_Jv_RunMain) use _Jv_SetArgs() instead of explicitly setting _Jv_argc and _Jv_argv * posix.cc: (_Jv_ThisExecutable) use _Jv_GetSafeArg() instead of _Jv_argv * java/lang/natRuntime.cc: (insertSystemProperties) use _Jv_GetSafeArg() instead of _Jv_argv From-SVN: r66067
2003-03-10[multiple changes]Andrew Haley1-0/+25
2003-03-10 2003-02-27 Mohan Embar <gnustuff@thisiscool.com> * include/jvm.h: removed declaration of _Jv_ThisExecutable() setter; made return value of getter const char* instead of char* * prims.cc: removed all references to _Jv_ThisExecutable(). These are in the platform-specific sections now. * posix.cc: define platform-specific _Jv_ThisExecutable(). Handle DISABLE_MAIN_ARGS and HAVE_PROC_SELF_EXE cases * win32.cc: define platform-specific _Jv_ThisExecutable() using GetModuleFilename() * java/lang/natRuntime.cc: set gnu.gcj.progname property to argv[0] instead of _Jv_ThisExecutable() 2003-03-10 Ranjit Mathew <rmathew@hotmail.com> * gnu/gcj/runtime/NameFinder.java (usingAddr2name): New flag that is set if we are using addr2name.awk instead of addr2line. (NameFinder): Set usingAddr2name if using addr2name.awk. (getExternalLabel): New native method to convert a method name to an external label. (lookup): Convert name given by addr2line to an external label before demangling. * gnu/gcj/runtime/natNameFinder.cc (LABEL_PREFIX): New string constant representing the prefix attached to method names to convert them to an external label. (gnu::gcj::runtime::NameFinder::getExternalLabel): Define using LABEL_PREFIX. From-SVN: r64111
2002-04-07natSystem.cc (init_properties): Call new function _Jv_platform_initProperties.Adam King1-0/+19
2002-04-07 Adam King <aking@dreammechanics.com> * java/lang/natSystem.cc (init_properties): Call new function _Jv_platform_initProperties. * win32 (_Jv_platform_initProperties): New function that adds Win32 support for the System properties os.name, os.arch, os.version, user.name, user.home, and user.dir. * include/posix.h, include/win32.h, posix.cc: New function _Jv_platform_initProperties. From-SVN: r51989
2002-03-09posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get truncated ↵Bryce McKinlay1-3/+3
to int. * posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't get truncated to int. From-SVN: r50479
2002-03-08posix.cc (internal_gettimeofday): New function.Tom Tromey1-2/+14
* posix.cc (internal_gettimeofday): New function. (_Jv_select): Use it. From-SVN: r50442
2002-03-08win32.cc (_Jv_platform_gettimeofday): Now takes no args, returns jlong.Adam Megacz1-11/+9
2002-03-07 Adam Megacz <adam@xwt.org> * win32.cc (_Jv_platform_gettimeofday): Now takes no args, returns jlong. Added implementation * posix.cc (_Jv_platform_gettimeofday): Now takes no args, returns jlong. * win32.h (_Jv_platform_gettimeofday): Now takes no args, returns jlong. * posix.h (_Jv_platform_gettimeofday): Now takes no args, returns jlong. * java/lang/natSystem.cc (currentTimeMillis): Now uses updated _Jv_platform_gettimeofday signature. From-SVN: r50416
2002-02-07prims.cc (_Jv_CreateJavaVM): Call _Jv_platform_initialize.Tom Tromey1-4/+21
* prims.cc (_Jv_CreateJavaVM): Call _Jv_platform_initialize. * win32.cc (win32_exception_handler): Now static. * include/win32.h (_Jv_platform_initialize): Declare. (win32_exception_handler): Don't declare. * java/lang/natSystem.cc (currentTimeMillis): Use _Jv_platform_gettimeofday. * posix.cc (_Jv_platform_gettimeofday): Renamed. (_Jv_select): Use new name. (_Jv_platform_initialize): New function. * include/posix.h (_Jv_platform_gettimeofday): Renamed from _Jv_gettimeofday. (_Jv_platform_initialize): Declare. From-SVN: r49583
2001-02-13re PR libgcj/1351 (_Jv_select -vs- Thread.interrupt)Tom Tromey1-1/+9
Fix for PR libgcj/1351: * posix.cc (_Jv_select): Throw InterruptedIOException if thread is interrupted. Include Thread.h and InterruptedIOException.h. From-SVN: r39639
2000-08-02Makefile.in: Rebuilt.Tom Tromey1-0/+104
* Makefile.in: Rebuilt. * Makefile.am (libgcj_la_SOURCES): Added posix.cc. * java/net/natPlainSocketImpl.cc: Include posix.h. (accept): Use _Jv_select. * java/net/natPlainDatagramSocketImpl.cc: Include posix.h. (receive): Use _Jv_select. * java/io/natFileDescriptorPosix.cc: Include posix.h. (available): Use _Jv_select. * java/lang/natSystem.cc: Include posix.h. (currentTimeMillis): Use _Jv_gettimeofday. * include/posix.h: New file. * posix.cc: New file. From-SVN: r35435