This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: p{read,write}{,64} mips n64 changes


Alexandre Oliva <aoliva at redhat dot com> writes:

> On Mar 20, 2003, Andreas Jaeger <aj at suse dot de> wrote:
>
>> I see - but I would nevertheless suggest something different
>
> Then please make your suggestion more explicit.  I still can't tell
> what you're looking for.  We pass arguments in different forms to
> __LONG_LONG_PAIR in the off64_t and off_t versions of the pread and
> pwrite functions, making a single-argument macro unsuitable.  We have
> to tweak the prototypes of the syscalls anyway.  A 3-argument macro,
> with one argument used on n64, and the other two passed to
> __LONG_LONG_PAIR on n32, to be defined in say sysdep.h is a
> possibility, but I find this extremely ugly.

My idea was (untested) to change the __LONG_LONG_PAIR here:

     result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
			      __LONG_LONG_PAIR ((off_t) (offset >> 32),
			      (off_t) (offset & 0xffffffff)));

to (no idea on the name yet):

__MIPS_LONG_LONG_PAIR (off_t, offset)

And have
#ifdef O32
#define __MIPS_LONG_LONG_PAIR(type, var) \
     __LONG_LONG_PAIR ((type) ((var) >> 32), \
		      (type) ((var) & 0xffffffff))
#elsif N64
#define __MIPS_LONG_LONG_PAIR(type, var) \
     (var)

etc.

Is this not feasible?


> Yet another possibility is to always extend the off_t value to
> off64_t, which would render the single-macro approach possible, yet
> with a small performance penalty.  It still leaves us with the problem
> of adjusting the prototypes.  I don't see any beautiful solution.

yes, the prototype needs special care,

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj at suse dot de
   private aj at arthur dot inka dot de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]