This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: Problems with rewinddir() on RTEMS


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


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