[RFC] [openjdk] provide milisecond modification timestamps

Thomas Meyer thomas at m3y3r.de
Mon Apr 23 10:53:15 PDT 2012


Am Montag, den 23.04.2012, 12:41 -0400 schrieb Andrew Hughes:
> ----- Original Message -----
> > diff -r 8ac52c85f9e9 src/solaris/native/java/io/UnixFileSystem_md.c
> > --- a/src/solaris/native/java/io/UnixFileSystem_md.c	Wed Feb 23
> > 15:49:19
> > 2011 -0800
> > +++ b/src/solaris/native/java/io/UnixFileSystem_md.c	Sat Apr 21
> > 10:11:26
> > 2012 +0200
> > @@ -197,7 +197,10 @@
> >      WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
> >          struct stat64 sb;
> >          if (stat64(path, &sb) == 0) {
> > -            rv = 1000 * (jlong)sb.st_mtime;
> > +            if(sb.st_mtimensec != 0)
> > +            	rv = (jlong)sb.st_mtimensec / 1000000;
> > +            else
> > +                rv = 1000 * (jlong)sb.st_mtime;
> >          }
> >      } END_PLATFORM_STRING(env, path);
> >      return rv;
> > 
> > 
> > 
> 

Hi Andrew,

> This looks a sensible improvement to me.  I can add it to the IcedTea
> repository.

But it only looks sensible :-) The correct patch against jdk7 is
attached!

I looks like the field st_mtim.tv_nsec is just an extension to the
second accuracy provided by st_mtim.tv_sec.

But I don't know if this compiles on Solaris, etc... But according to
the man page of stat() it should compile if compatible to POSIX.1-2008.

> 
> Have you signed the Oracle Contributor Agreement (OCA) so it can also
> be upstreamed to OpenJDK?

Not yet...

thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: provide-millisecond-timestamp.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120423/38fd1493/provide-millisecond-timestamp.patch 


More information about the distro-pkg-dev mailing list