Philip Blundell writes:
> In message <[EMAIL PROTECTED]>, Paul Koning writes:
> >>>>>> "Russell" == Russell King <- ARM Linux Admin <[EMAIL PROTECTED]>> w
> >rites:
> > Russell> Try compiling it with -Wall.  You will get warnings.  For
> > Russell> starters, llseek doesn't take a FILE * argument as the first
> > Russell> parameter.  Secondly, it returns an "int".
> >
> >I guess it's a naming error then -- because surely naming something
> >"llseek" when it doesn't return a "long long int" is a misleading
> >thing to do...
> 
> I think Russell is mistaken; the return value of llseek() is actually loff_t, 
> which is equivalent to long long.

Probably - just checked my only glibc source (2.0.99) and it does return
loff_t.  However, if its not prototyped, then GCC will default it to return
an int.

Therefore, there are still two errors on the program:

1. It's passing a FILE * instead of an int as the first argument.
2. The C compiler believes, since there is no prototype to tell it otherwise,
   that llseek returns an int.

1 can be fixed by using fseeko64 - there is no fseek64 in that version of glibc,
nor the later glibc headers.

2 can be fixed merely by supplying the appropriate prototype:

        loff_t __llseek (int fd, loff_t offset, int whence);
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [EMAIL PROTECTED]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
++        Please use [EMAIL PROTECTED] for           ++
++                        kernel-related discussions.                      ++

Reply via email to