summaryrefslogtreecommitdiff
path: root/libjava/posix.cc
Commit message (Collapse)AuthorAgeFilesLines
* libjava/jakub2007-02-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122229 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix.cc (_Jv_platform_nanotime): Return nanoseconds, notgeoffk2006-09-141-2/+10
| | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116941 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-07-04 Andreas Tobler <a.tobler@schweiz.ch>andreast2006-07-041-1/+1
| | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115184 138bc75d-0d04-0410-961f-82ee72b054a4
* * gcj/javaprims.h (_Jv_uintptr_t): New typedef similar to uintptr_t inrmathew2006-06-291-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115069 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-03-31 Andreas Tobler <a.tobler@schweiz.ch>andreast2006-03-311-1/+1
| | | | | | | * posix.cc (_Jv_platform_nanotime): Declare id with clockid_t. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112587 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix.cc (_Jv_platform_nanotime): Look for CLOCK_MONOTONIC andtromey2006-03-291-1/+9
| | | | | | CLOCK_HIGHRES. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112494 138bc75d-0d04-0410-961f-82ee72b054a4
* * win32.cc (_Jv_platform_nanotime): New function.tromey2006-03-091-1/+17
| | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111869 138bc75d-0d04-0410-961f-82ee72b054a4
* 2006-02-08 Bryce McKinlay <mckinlay@redhat.com>bryce2006-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110783 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-07-07 Adam Megacz <adam@xwt.org>megacz2003-07-081-0/+1
| | | | | | | * posix.cc: added #include<stdio.h> git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69066 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-03-29 Mohan Embar <gnustuff@thisiscool.com>aph2003-04-251-4/+1
| | | | | | | | | | | | | | | | | | * 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66067 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-03-10 2003-02-27 Mohan Embar <gnustuff@thisiscool.com>aph2003-03-101-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64111 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-04-07 Adam King <aking@dreammechanics.com>bryce2002-04-071-0/+19
| | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51989 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix.cc (_Jv_platform_gettimeofday): Make sure result doesn't getbryce2002-03-091-3/+3
| | | | | | | truncated to int. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50479 138bc75d-0d04-0410-961f-82ee72b054a4
* * posix.cc (internal_gettimeofday): New function.tromey2002-03-081-2/+14
| | | | | | | (_Jv_select): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50442 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-03-07 Adam Megacz <adam@xwt.org>megacz2002-03-081-11/+9
| | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50416 138bc75d-0d04-0410-961f-82ee72b054a4
* * prims.cc (_Jv_CreateJavaVM): Call _Jv_platform_initialize.tromey2002-02-071-4/+21
| | | | | | | | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49583 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix for PR libgcj/1351:tromey2001-02-131-1/+9
| | | | | | | | | * posix.cc (_Jv_select): Throw InterruptedIOException if thread is interrupted. Include Thread.h and InterruptedIOException.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39639 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in: Rebuilt.tromey2000-08-021-0/+104
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35435 138bc75d-0d04-0410-961f-82ee72b054a4