From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81686 invoked by alias); 9 Mar 2015 11:58:31 -0000 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 Received: (qmail 81601 invoked by uid 89); 9 Mar 2015 11:58:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Mar 2015 11:58:27 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t29BwQI7016884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 9 Mar 2015 07:58:26 -0400 Received: from blade.nx (ovpn-116-107.ams2.redhat.com [10.36.116.107]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t29BwNl7027303 for ; Mon, 9 Mar 2015 07:58:25 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id D8C7C26506C for ; Mon, 9 Mar 2015 11:58:22 +0000 (GMT) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH 1/3] Move remote_fileio_to_fio_stat to gdb/common Date: Mon, 09 Mar 2015 11:58:00 -0000 Message-Id: <1425902299-2151-2-git-send-email-gbenson@redhat.com> In-Reply-To: <1425902299-2151-1-git-send-email-gbenson@redhat.com> References: <1425902299-2151-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00218.txt.bz2 This patch moves remote_fileio_to_fio_stat and its supporting functions into new files common/common-remote-fileio.[ch]. gdb/ChangeLog: * common/common-remote-fileio.h: New file. * common/common-remote-fileio.c: Likewise. * Makefile.in (SFILES): Add common/common-remote-fileio.c. (HFILES_NO_SRCDIR): Add common/common-remote-fileio.h. (COMMON_OBS): Add common-remote-fileio.o. (common-remote-fileio.o): New rule. * remote-fileio.h (common-remote-fileio.h): New include. * remote-fileio.c (gdb/fileio.h): Do not include. (remote_fileio_to_be): Moved to common-remote-fileio.h. (remote_fileio_to_fio_uint): Likewise. (remote_fileio_to_fio_time): Likewise. (remote_fileio_mode_to_target): Moved to common-remote-fileio.c. (remote_fileio_to_fio_mode): Likewise. (remote_fileio_to_fio_ulong): Likewise. (remote_fileio_to_fio_stat): Likewise. gdb/gdbserver/ChangeLog: * configure.ac (AC_CHECK_MEMBERS): Add checks for struct stat.st_blocks and struct stat.st_blksize. * configure: Regenerate. * config.in: Likewise. * Makefile.in (SFILES): Add common/common-remote-fileio.c. (OBS): Add common-remote-fileio.o. (common-remote-fileio.o): New rule. --- gdb/ChangeLog | 18 ++++++ gdb/Makefile.in | 10 ++- gdb/common/common-remote-fileio.c | 119 +++++++++++++++++++++++++++++++++++++ gdb/common/common-remote-fileio.h | 61 +++++++++++++++++++ gdb/gdbserver/ChangeLog | 10 +++ gdb/gdbserver/Makefile.in | 8 ++- gdb/gdbserver/config.in | 6 ++ gdb/gdbserver/configure | 77 ++++++++++++++++++++++++ gdb/gdbserver/configure.ac | 2 + gdb/remote-fileio.c | 111 ---------------------------------- gdb/remote-fileio.h | 2 + 11 files changed, 308 insertions(+), 116 deletions(-) create mode 100644 gdb/common/common-remote-fileio.c create mode 100644 gdb/common/common-remote-fileio.h diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 8c2a4de..0ddcd72 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -877,7 +877,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ common/format.c common/filestuff.c btrace.c record-btrace.c ctf.c \ target/waitstatus.c common/print-utils.c common/rsp-low.c \ common/errors.c common/common-debug.c common/common-exceptions.c \ - common/btrace-common.c \ + common/btrace-common.c common/common-remote-fileio.c \ $(SUBDIR_GCC_COMPILE_SRCS) LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c @@ -966,7 +966,8 @@ common/print-utils.h common/rsp-low.h nat/x86-dregs.h x86-linux-nat.h \ i386-linux-nat.h common/common-defs.h common/errors.h common/common-types.h \ common/common-debug.h common/cleanups.h common/gdb_setjmp.h \ common/common-exceptions.h target/target.h common/symbol.h \ -common/common-regcache.h fbsd-tdep.h nat/linux-personality.h +common/common-regcache.h fbsd-tdep.h nat/linux-personality.h \ +common/common-remote-fileio.h # Header files that already have srcdir in them, or which are in objdir. @@ -1065,7 +1066,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ common-utils.o buffer.o ptid.o gdb-dlfcn.o common-agent.o \ format.o registry.o btrace.o record-btrace.o waitstatus.o \ print-utils.o rsp-low.o errors.o common-debug.o debug.o \ - common-exceptions.o btrace-common.o \ + common-exceptions.o btrace-common.o common-remote-fileio.o \ $(SUBDIR_GCC_COMPILE_OBS) TSOBS = inflow.o @@ -2244,6 +2245,9 @@ btrace-common.o: ${srcdir}/common/btrace-common.c $(COMPILE) $(srcdir)/common/btrace-common.c $(POSTCOMPILE) +common-remote-fileio.o: ${srcdir}/common/common-remote-fileio.c + $(COMPILE) $(srcdir)/common/common-remote-fileio.c + $(POSTCOMPILE) # # gdb/target/ dependencies # diff --git a/gdb/common/common-remote-fileio.c b/gdb/common/common-remote-fileio.c new file mode 100644 index 0000000..f78b3f7 --- /dev/null +++ b/gdb/common/common-remote-fileio.c @@ -0,0 +1,119 @@ +/* Remote File-I/O communications + + Copyright (C) 2003-2015 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include "common-defs.h" +#include "common-remote-fileio.h" +#include + +/* Convert a host-format mode_t into a bitmask of File-I/O flags. */ + +static LONGEST +remote_fileio_mode_to_target (mode_t mode) +{ + mode_t tmode = 0; + + if (S_ISREG (mode)) + tmode |= FILEIO_S_IFREG; + if (S_ISDIR (mode)) + tmode |= FILEIO_S_IFDIR; + if (S_ISCHR (mode)) + tmode |= FILEIO_S_IFCHR; + if (mode & S_IRUSR) + tmode |= FILEIO_S_IRUSR; + if (mode & S_IWUSR) + tmode |= FILEIO_S_IWUSR; + if (mode & S_IXUSR) + tmode |= FILEIO_S_IXUSR; +#ifdef S_IRGRP + if (mode & S_IRGRP) + tmode |= FILEIO_S_IRGRP; +#endif +#ifdef S_IWRGRP + if (mode & S_IWGRP) + tmode |= FILEIO_S_IWGRP; +#endif +#ifdef S_IXGRP + if (mode & S_IXGRP) + tmode |= FILEIO_S_IXGRP; +#endif + if (mode & S_IROTH) + tmode |= FILEIO_S_IROTH; +#ifdef S_IWOTH + if (mode & S_IWOTH) + tmode |= FILEIO_S_IWOTH; +#endif +#ifdef S_IXOTH + if (mode & S_IXOTH) + tmode |= FILEIO_S_IXOTH; +#endif + return tmode; +} + +/* Pack a host-format mode_t into an fio_mode_t. */ + +static void +remote_fileio_to_fio_mode (mode_t num, fio_mode_t fnum) +{ + remote_fileio_to_be (remote_fileio_mode_to_target (num), + (char *) fnum, 4); +} + +/* Pack a host-format integer into an fio_ulong_t. */ + +static void +remote_fileio_to_fio_ulong (LONGEST num, fio_ulong_t fnum) +{ + remote_fileio_to_be (num, (char *) fnum, 8); +} + +/* See common-remote-fileio.h. */ + +void +remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst) +{ + LONGEST blksize; + + remote_fileio_to_fio_uint ((long) st->st_dev, fst->fst_dev); + remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino); + remote_fileio_to_fio_mode (st->st_mode, fst->fst_mode); + remote_fileio_to_fio_uint ((long) st->st_nlink, fst->fst_nlink); + remote_fileio_to_fio_uint ((long) st->st_uid, fst->fst_uid); + remote_fileio_to_fio_uint ((long) st->st_gid, fst->fst_gid); + remote_fileio_to_fio_uint ((long) st->st_rdev, fst->fst_rdev); + remote_fileio_to_fio_ulong ((LONGEST) st->st_size, fst->fst_size); +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + blksize = st->st_blksize; +#else + blksize = 512; +#endif + remote_fileio_to_fio_ulong (blksize, fst->fst_blksize); +#if HAVE_STRUCT_STAT_ST_BLOCKS + remote_fileio_to_fio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); +#else + /* FIXME: This is correct for DJGPP, but other systems that don't + have st_blocks, if any, might prefer 512 instead of st_blksize. + (eliz, 30-12-2003) */ + remote_fileio_to_fio_ulong (((LONGEST) st->st_size + blksize - 1) + / blksize, + fst->fst_blocks); +#endif + remote_fileio_to_fio_time (st->st_atime, fst->fst_atime); + remote_fileio_to_fio_time (st->st_mtime, fst->fst_mtime); + remote_fileio_to_fio_time (st->st_ctime, fst->fst_ctime); +} diff --git a/gdb/common/common-remote-fileio.h b/gdb/common/common-remote-fileio.h new file mode 100644 index 0000000..b838186 --- /dev/null +++ b/gdb/common/common-remote-fileio.h @@ -0,0 +1,61 @@ +/* Remote File-I/O communications + + Copyright (C) 2003-2015 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef COMMON_REMOTE_FILEIO_H +#define COMMON_REMOTE_FILEIO_H + +#include "gdb/fileio.h" + +struct stat; + +/* Pack a host-format integer into a byte buffer in big-endian format + ready for transmission over the remote protocol. BYTES specifies + the size of the integer to pack in bytes. */ + +static inline void +remote_fileio_to_be (LONGEST num, char *buf, int bytes) +{ + int i; + + for (i = 0; i < bytes; ++i) + buf[i] = (num >> (8 * (bytes - i - 1))) & 0xff; +} + +/* Pack a host-format integer into an fio_uint_t. */ + +static inline void +remote_fileio_to_fio_uint (long num, fio_uint_t fnum) +{ + remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); +} + +/* Pack a host-format time_t into an fio_time_t. */ + +static inline void +remote_fileio_to_fio_time (time_t num, fio_time_t fnum) +{ + remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); +} + +/* Pack a host-format struct stat into a struct fio_stat. */ + +extern void remote_fileio_to_fio_stat (struct stat *st, + struct fio_stat *fst); + +#endif /* COMMON_REMOTE_FILEIO_H */ diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 6dddf26..b425ee2 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -179,7 +179,8 @@ SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \ $(srcdir)/common/rsp-low.c $(srcdir)/common/errors.c \ $(srcdir)/common/common-debug.c $(srcdir)/common/cleanups.c \ $(srcdir)/common/common-exceptions.c $(srcdir)/symbol.c \ - $(srcdir)/common/btrace-common.c + $(srcdir)/common/btrace-common.c \ + $(srcdir)/common/common-remote-fileio.c DEPFILES = @GDBSERVER_DEPFILES@ @@ -193,7 +194,7 @@ OBS = agent.o ax.o inferiors.o regcache.o remote-utils.o server.o signals.o \ mem-break.o hostio.o event-loop.o tracepoint.o xml-utils.o \ common-utils.o ptid.o buffer.o format.o filestuff.o dll.o notif.o \ tdesc.o print-utils.o rsp-low.o errors.o common-debug.o cleanups.o \ - common-exceptions.o symbol.o btrace-common.o \ + common-exceptions.o symbol.o btrace-common.o common-remote-fileio.o \ $(XML_BUILTIN) $(DEPFILES) $(LIBOBJS) GDBREPLAY_OBS = gdbreplay.o version.o GDBSERVER_LIBS = @GDBSERVER_LIBS@ @@ -572,6 +573,9 @@ common-exceptions.o: ../common/common-exceptions.c waitstatus.o: ../target/waitstatus.c $(COMPILE) $< $(POSTCOMPILE) +common-remote-fileio.o: ../common/common-remote-fileio.c + $(COMPILE) $< + $(POSTCOMPILE) # Native object files rules from ../nat diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in index 8114628..3c3bfca 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -210,6 +210,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if `struct stat' is a member of `st_blksize'. */ +#undef HAVE_STRUCT_STAT_ST_BLKSIZE + +/* Define to 1 if `struct stat' is a member of `st_blocks'. */ +#undef HAVE_STRUCT_STAT_ST_BLOCKS + /* Define to 1 if the target supports __sync_*_compare_and_swap */ #undef HAVE_SYNC_BUILTINS diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index a14def9..6e807fd 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -2109,6 +2109,63 @@ rm -f conftest.val return $ac_retval } # ac_fn_c_compute_int + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -6083,6 +6140,26 @@ cat >>confdefs.h <<_ACEOF _ACEOF +ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" +if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +_ACEOF + + +fi + + ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #include diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index cefc69e..8d0b4e3 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -224,6 +224,8 @@ libiberty_INIT AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf]) +AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize]) + AC_CHECK_TYPES(socklen_t, [], [], [#include #include diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 00a86ca..0ce0714 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -22,7 +22,6 @@ #include "defs.h" #include "gdbcmd.h" #include "remote.h" -#include "gdb/fileio.h" #include "gdb_wait.h" #include #include "remote-fileio.h" @@ -194,48 +193,6 @@ remote_fileio_mode_to_host (long mode, int open_call) return hmode; } -static LONGEST -remote_fileio_mode_to_target (mode_t mode) -{ - mode_t tmode = 0; - - if (S_ISREG(mode)) - tmode |= FILEIO_S_IFREG; - if (S_ISDIR(mode)) - tmode |= FILEIO_S_IFDIR; - if (S_ISCHR(mode)) - tmode |= FILEIO_S_IFCHR; - if (mode & S_IRUSR) - tmode |= FILEIO_S_IRUSR; - if (mode & S_IWUSR) - tmode |= FILEIO_S_IWUSR; - if (mode & S_IXUSR) - tmode |= FILEIO_S_IXUSR; -#ifdef S_IRGRP - if (mode & S_IRGRP) - tmode |= FILEIO_S_IRGRP; -#endif -#ifdef S_IWRGRP - if (mode & S_IWGRP) - tmode |= FILEIO_S_IWGRP; -#endif -#ifdef S_IXGRP - if (mode & S_IXGRP) - tmode |= FILEIO_S_IXGRP; -#endif - if (mode & S_IROTH) - tmode |= FILEIO_S_IROTH; -#ifdef S_IWOTH - if (mode & S_IWOTH) - tmode |= FILEIO_S_IWOTH; -#endif -#ifdef S_IXOTH - if (mode & S_IXOTH) - tmode |= FILEIO_S_IXOTH; -#endif - return tmode; -} - static int remote_fileio_errno_to_target (int error) { @@ -381,34 +338,6 @@ remote_fileio_extract_ptr_w_len (char **buf, CORE_ADDR *ptrval, int *length) return 0; } -/* Convert to big endian. */ -static void -remote_fileio_to_be (LONGEST num, char *buf, int bytes) -{ - int i; - - for (i = 0; i < bytes; ++i) - buf[i] = (num >> (8 * (bytes - i - 1))) & 0xff; -} - -static void -remote_fileio_to_fio_uint (long num, fio_uint_t fnum) -{ - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); -} - -static void -remote_fileio_to_fio_mode (mode_t num, fio_mode_t fnum) -{ - remote_fileio_to_be (remote_fileio_mode_to_target(num), (char *) fnum, 4); -} - -static void -remote_fileio_to_fio_time (time_t num, fio_time_t fnum) -{ - remote_fileio_to_be ((LONGEST) num, (char *) fnum, 4); -} - static void remote_fileio_to_fio_long (LONGEST num, fio_long_t fnum) { @@ -416,46 +345,6 @@ remote_fileio_to_fio_long (LONGEST num, fio_long_t fnum) } static void -remote_fileio_to_fio_ulong (LONGEST num, fio_ulong_t fnum) -{ - remote_fileio_to_be (num, (char *) fnum, 8); -} - -static void -remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst) -{ - LONGEST blksize; - - /* `st_dev' is set in the calling function. */ - remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino); - remote_fileio_to_fio_mode (st->st_mode, fst->fst_mode); - remote_fileio_to_fio_uint ((long) st->st_nlink, fst->fst_nlink); - remote_fileio_to_fio_uint ((long) st->st_uid, fst->fst_uid); - remote_fileio_to_fio_uint ((long) st->st_gid, fst->fst_gid); - remote_fileio_to_fio_uint ((long) st->st_rdev, fst->fst_rdev); - remote_fileio_to_fio_ulong ((LONGEST) st->st_size, fst->fst_size); -#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE - blksize = st->st_blksize; -#else - blksize = 512; -#endif - remote_fileio_to_fio_ulong (blksize, fst->fst_blksize); -#if HAVE_STRUCT_STAT_ST_BLOCKS - remote_fileio_to_fio_ulong ((LONGEST) st->st_blocks, fst->fst_blocks); -#else - /* FIXME: This is correct for DJGPP, but other systems that don't - have st_blocks, if any, might prefer 512 instead of st_blksize. - (eliz, 30-12-2003) */ - remote_fileio_to_fio_ulong (((LONGEST) st->st_size + blksize - 1) - / blksize, - fst->fst_blocks); -#endif - remote_fileio_to_fio_time (st->st_atime, fst->fst_atime); - remote_fileio_to_fio_time (st->st_mtime, fst->fst_mtime); - remote_fileio_to_fio_time (st->st_ctime, fst->fst_ctime); -} - -static void remote_fileio_to_fio_timeval (struct timeval *tv, struct fio_timeval *ftv) { remote_fileio_to_fio_time (tv->tv_sec, ftv->ftv_sec); diff --git a/gdb/remote-fileio.h b/gdb/remote-fileio.h index 40a614a..8b32868 100644 --- a/gdb/remote-fileio.h +++ b/gdb/remote-fileio.h @@ -22,6 +22,8 @@ #ifndef REMOTE_FILEIO_H #define REMOTE_FILEIO_H +#include "common-remote-fileio.h" + struct cmd_list_element; /* Unified interface to remote fileio, called in remote.c from -- 1.7.1