rtems 4.9 build failure due to new unistd.h

Ralf Corsepius ralf.corsepius at rtems.org
Mon Dec 8 08:18:24 UTC 2008


On Mon, 2008-12-08 at 02:45 -0500, Gene Smith wrote:
> I recently tried to do a "make clean all" of rtems and it fails when 
> compiling ttyname.c: ttyname_r() with a complaint that it differs from 
> the declaration in unistd.h.  ttyname_r() has parameter namesize 
> declared as int while in unistd.h it is size_t and declared only for 
> cygwin and rtems.
Correct. This will soon change. RTEMS's unistd.h not having declared
ttyname_r() is a bug.

> I think unistd.h (under /opt/rtems-4.9/arm-rtems4.9/include/sys) was 
> recently yum updated
Also correct. The arm-rtems4.9-gcc/newlib have been updated, because I
had discovered a serious bug with it.

Unfortunately, I missed the fact that the new ttyname_r change, doesn't
meet rtems-4.9.0's demands. Sorry for that.

FWIW: All rtems-4.9.1 toolchains will be updated with this change,
accompanied with an upgrade to binutils-2.19, in parallel to the
rtems-4.9.1 toolchain.

Unless something very nasty should happen, this can be expected to
happen any time soon, almost for sure during this week.

>  since on another machine which has not been 
> recently updated it only declares ttyname_r() in unistd.h for cygwin and 
> not for rtems, so there is no conflict.
> 
> Anyhow, I ended up changing namesize from int to a size_t in 
> rtems-4.9.0/cpukit/libcsupport/src/ttyname.c.
This is the right (tm) fix. It already is part of CVS on
rtems-4-9-branch and will be part of the upcoming rtems-4.9.1

> -gene
> P/S:
> It seems that namesize is not actually used in posix function 
> ttyname_r().
This doesn't matter, ttyname_r/ttyname are specified by POSIX, so we
don't have any choice.

>  Also, is "Demetermine" a real word?
:) Nah .... I already fixed this many times on different versions of
RTEMS, but would not exclude to have missed some "incarnations."

Ralf





More information about the users mailing list