On Tuesday 24 December 2013 06:42:38 zenglg.jy wrote: > On Tue, 2013-12-24 at 19:35 +0800, zenglg.jy wrote: > > >From edb98f0b69c16f612f79fe24d10597af47424f13 Mon Sep 17 00:00:00 2001 > > > > From: Zeng Linggang <[email protected]> > > Date: Tue, 24 Dec 2013 19:21:32 +0800 > > Subject: [PATCH] fallocate/fallocate.h: move inline function > > > > Moved common inline function to fallocate.h > > > > Signed-off-by: Zeng Linggang <[email protected]> > > --- > > > > testcases/kernel/syscalls/fallocate/fallocate.h | 47 > > +++++++++++++++++++++++ > > testcases/kernel/syscalls/fallocate/fallocate01.c | 23 +---------- > > testcases/kernel/syscalls/fallocate/fallocate02.c | 19 +-------- > > testcases/kernel/syscalls/fallocate/fallocate03.c | 19 +-------- 4 > > files changed, 50 insertions(+), 58 deletions(-) > > create mode 100644 testcases/kernel/syscalls/fallocate/fallocate.h > > > > diff --git a/testcases/kernel/syscalls/fallocate/fallocate.h > > b/testcases/kernel/syscalls/fallocate/fallocate.h new file mode 100644 > > index 0000000..e47338b > > --- /dev/null > > +++ b/testcases/kernel/syscalls/fallocate/fallocate.h > > @@ -0,0 +1,47 @@ > > +/* > > + * Copyright (c) International Business Machines Corp., 2007 > > + * Copyright (c) 2013 Fujitsu Ltd. > > + * > > + * 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 2 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 Library General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with this program; if not, write to the Free Software > > + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, > > USA. + * > > + */ > > + > > +#ifndef FALLOCATE_H > > +#define FALLOCATE_H > > + > > +#include <sys/types.h> > > +#include <endian.h> > > +#include "linux_syscall_numbers.h" > > + > > +static inline long fallocate(int fd, int mode, loff_t offset, loff_t > > len) +{ > > +/* > > + * Use __WORDSIZE will fail on ABI's that have 64bit registers but 32bit > > + * longs like MIPS n32 and x86_64 x32 > > + */ > > I do not know about the ABI's problem. Could someone give me a help.
you can check for mips n32 by doing:
#if defined(__mips__) && _MIPS_SIM == _ABIN32
you can check for x86_64 x32 by doing:
#if defined(__x86_64__) && defined(__ILP32__)
these should use the 64bit code path
-mike
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
