From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32766 invoked by alias); 12 Jan 2012 19:54:58 -0000 Received: (qmail 32758 invoked by uid 22791); 12 Jan 2012 19:54:56 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from qmta12.emeryville.ca.mail.comcast.net (HELO qmta12.emeryville.ca.mail.comcast.net) (76.96.27.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jan 2012 19:54:41 +0000 Received: from omta15.emeryville.ca.mail.comcast.net ([76.96.30.71]) by qmta12.emeryville.ca.mail.comcast.net with comcast id Likq1i0021Y3wxoACjuh1a; Thu, 12 Jan 2012 19:54:41 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta15.emeryville.ca.mail.comcast.net with comcast id Ljug1i00A0BKwT48bjugfQ; Thu, 12 Jan 2012 19:54:41 +0000 From: Mike Stump Content-Type: multipart/mixed; boundary=Apple-Mail-25-198529026 Subject: Add support for nanoseconds Date: Thu, 12 Jan 2012 20:36:00 -0000 Message-Id: <43751958-6553-4855-BDED-65AA5B3582E0@comcast.net> To: gdb-patches@sourceware.org Mime-Version: 1.0 (Apple Message framework v1084) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00429.txt.bz2 --Apple-Mail-25-198529026 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Content-length: 4009 I'd like to add support for nanoseconds to stat in the simulator: Index: sim/common/configure.ac =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sim/common/configure.ac (revision 1988) +++ sim/common/configure.ac (working copy) @@ -42,7 +42,9 @@ AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid], [struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size], [struct stat.st_blksize], [struct stat.st_blocks], [struct stat.st_atime], -[struct stat.st_mtime], [struct stat.st_ctime]], [], [], +[struct stat.st_mtime], [struct stat.st_ctime], [struct stat.st_atimensec], +[struct stat.st_mtimensec], [struct stat.st_ctimensec], [struct stat.st_at= im.tv_nsec], +[struct stat.st_mtim.tv_nsec], [struct stat.st_ctim.tv_nsec]], [], [], [[#ifdef HAVE_SYS_TYPES_H #include #endif Index: sim/common/config.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sim/common/config.in (revision 1988) +++ sim/common/config.in (working copy) @@ -64,6 +64,12 @@ /* Define to 1 if `struct stat' is a member of `st_atime'. */ #undef HAVE_STRUCT_STAT_ST_ATIME =20 +/* Define to 1 if `struct stat' is a member of `st_atimensec'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if `struct stat' is a member of `st_atim.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + /* Define to 1 if `struct stat' is a member of `st_blksize'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE =20 @@ -73,6 +79,12 @@ /* Define to 1 if `struct stat' is a member of `st_ctime'. */ #undef HAVE_STRUCT_STAT_ST_CTIME =20 +/* Define to 1 if `struct stat' is a member of `st_ctimensec'. */ +#undef HAVE_STRUCT_STAT_ST_CTIMENSEC + +/* Define to 1 if `struct stat' is a member of `st_ctim.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + /* Define to 1 if `struct stat' is a member of `st_dev'. */ #undef HAVE_STRUCT_STAT_ST_DEV =20 @@ -88,6 +100,12 @@ /* Define to 1 if `struct stat' is a member of `st_mtime'. */ #undef HAVE_STRUCT_STAT_ST_MTIME =20 +/* Define to 1 if `struct stat' is a member of `st_mtimensec'. */ +#undef HAVE_STRUCT_STAT_ST_MTIMENSEC + +/* Define to 1 if `struct stat' is a member of `st_mtim.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + /* Define to 1 if `struct stat' is a member of `st_nlink'. */ #undef HAVE_STRUCT_STAT_ST_NLINK =20 Index: sim/common/callback.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sim/common/callback.c (revision 1988) +++ sim/common/callback.c (working copy) @@ -1166,12 +1166,30 @@ cb_host_to_target_stat (cb, hs, ts) #ifdef HAVE_STRUCT_STAT_ST_ATIME ST_x (st_atime); #endif +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + ST_x (st_atim.tv_nsec); +#endif +#ifdef HAVE_STRUCT_STAT_ST_ATIMENSEC + ST_x (st_atimensec); +#endif #ifdef HAVE_STRUCT_STAT_ST_MTIME ST_x (st_mtime); #endif +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + ST_x (st_mtim.tv_nsec); +#endif +#ifdef HAVE_STRUCT_STAT_ST_MTIMENSEC + ST_x (st_mtimensec); +#endif #ifdef HAVE_STRUCT_STAT_ST_CTIME ST_x (st_ctime); #endif +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + ST_x (st_ctim.tv_nsec); +#endif +#ifdef HAVE_STRUCT_STAT_ST_CTIMENSEC + ST_x (st_ctimensec); +#endif #undef ST_x /* FIXME:wip */ else This patch might be dependent upon a nanosecond patch to newlib, though, I = think it is safe without it. I didn't include the sim/common/configure pat= ch, as it just needs to be regenerated. The names used come from linux. W= ith this patch, I have working nanosecond support in my port. --Apple-Mail-25-198529026 Content-Disposition: attachment; filename=b1.patch.txt Content-Type: text/plain; name="b1.patch.txt" Content-Transfer-Encoding: quoted-printable Content-length: 3645 Index: sim/common/configure.ac =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sim/common/configure.ac (revision 1988) +++ sim/common/configure.ac (working copy) @@ -42,7 +42,9 @@ AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_mode], [struct stat.st_nlink], [struct stat.st_uid], [struct stat.st_gid], [struct stat.st_rdev], [struct stat.st_size], [struct stat.st_blksize], [struct stat.st_blocks], [struct stat.st_atime], -[struct stat.st_mtime], [struct stat.st_ctime]], [], [], +[struct stat.st_mtime], [struct stat.st_ctime], [struct stat.st_atimensec], +[struct stat.st_mtimensec], [struct stat.st_ctimensec], [struct stat.st_at= im.tv_nsec], +[struct stat.st_mtim.tv_nsec], [struct stat.st_ctim.tv_nsec]], [], [], [[#ifdef HAVE_SYS_TYPES_H #include #endif Index: sim/common/config.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sim/common/config.in (revision 1988) +++ sim/common/config.in (working copy) @@ -64,6 +64,12 @@ /* Define to 1 if `struct stat' is a member of `st_atime'. */ #undef HAVE_STRUCT_STAT_ST_ATIME =20 +/* Define to 1 if `struct stat' is a member of `st_atimensec'. */ +#undef HAVE_STRUCT_STAT_ST_ATIMENSEC + +/* Define to 1 if `struct stat' is a member of `st_atim.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + /* Define to 1 if `struct stat' is a member of `st_blksize'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE =20 @@ -73,6 +79,12 @@ /* Define to 1 if `struct stat' is a member of `st_ctime'. */ #undef HAVE_STRUCT_STAT_ST_CTIME =20 +/* Define to 1 if `struct stat' is a member of `st_ctimensec'. */ +#undef HAVE_STRUCT_STAT_ST_CTIMENSEC + +/* Define to 1 if `struct stat' is a member of `st_ctim.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + /* Define to 1 if `struct stat' is a member of `st_dev'. */ #undef HAVE_STRUCT_STAT_ST_DEV =20 @@ -88,6 +100,12 @@ /* Define to 1 if `struct stat' is a member of `st_mtime'. */ #undef HAVE_STRUCT_STAT_ST_MTIME =20 +/* Define to 1 if `struct stat' is a member of `st_mtimensec'. */ +#undef HAVE_STRUCT_STAT_ST_MTIMENSEC + +/* Define to 1 if `struct stat' is a member of `st_mtim.tv_nsec'. */ +#undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + /* Define to 1 if `struct stat' is a member of `st_nlink'. */ #undef HAVE_STRUCT_STAT_ST_NLINK =20 Index: sim/common/callback.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sim/common/callback.c (revision 1988) +++ sim/common/callback.c (working copy) @@ -1166,12 +1166,30 @@ cb_host_to_target_stat (cb, hs, ts) #ifdef HAVE_STRUCT_STAT_ST_ATIME ST_x (st_atime); #endif +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + ST_x (st_atim.tv_nsec); +#endif +#ifdef HAVE_STRUCT_STAT_ST_ATIMENSEC + ST_x (st_atimensec); +#endif #ifdef HAVE_STRUCT_STAT_ST_MTIME ST_x (st_mtime); #endif +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + ST_x (st_mtim.tv_nsec); +#endif +#ifdef HAVE_STRUCT_STAT_ST_MTIMENSEC + ST_x (st_mtimensec); +#endif #ifdef HAVE_STRUCT_STAT_ST_CTIME ST_x (st_ctime); #endif +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC + ST_x (st_ctim.tv_nsec); +#endif +#ifdef HAVE_STRUCT_STAT_ST_CTIMENSEC + ST_x (st_ctimensec); +#endif #undef ST_x /* FIXME:wip */ else --Apple-Mail-25-198529026--