Problems with rewinddir() on RTEMS
Ralf Corsepius
ralf.corsepius@rtems.org
Mon Jul 5 15:49:00 GMT 2010
On 07/05/2010 01:47 PM, Corinna Vinschen wrote:
> On Jul 5 11:24, Sebastian Huber wrote:
>> Hi,
>>
>> on some platforms RTEMS uses a 64-bit type for off_t (in particular PowerPC).
>> The function rewinddir() is implemented (libc/posix/rewinddir.c) in terms of:
>>
>> _seekdir((dirp), (off_t)0);
>>
>> For _seekdir() no prototype is present. GCC chooses to pass (off_t) 0 as a
>> 64-bit parameter (on PowerPC r5 and r6). On the other hand we have
>> (libc/posix/telldir.c):
>>
>> void
>> _DEFUN(_seekdir, (dirp, loc),
>> register DIR *dirp _AND
>> long loc)
>>
>> Which has a different signature compared to above (on PowerPC r4 will contain
>> loc). We must declare _seekdir() somewhere.
>
> Not only _seekdir is wrongly defined taking a long type, seekdir is,
> too, and telldir is wrongly defined returning a long. Both functions
> should use off_t per POSIX.
Hmm? Opengroup says otherwise:
void seekdir(DIR *dirp, long loc);
long telldir(DIR *);
Ralf
More information about the Newlib
mailing list