This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: [PATCH] add ftok() and getenv() functions to the synthetic target
On Tue, Oct 25, 2005 at 10:13:15PM +0200, Alexander Neundorf wrote:
> On Wednesday 19 October 2005 19:20, Alexander Neundorf wrote:
> > Hi,
> >
> > the attached patch implements ftok() and getenv() for the synthetic target.
> > This is quite useful, since often ipc keys are generated using ftok() and
> > environment variables (getenv()).
> > Both ftok() and getenv() are taken from FreeBSD. The FreeBSD getenv() is
> > smaller and has no dependencies as compared to the eCos getenv() (which
> > uses strlen() and strncmp()).
I don't see the point in the getenv() code. Why not just
environ = cyg_hal_sys_environ;
and then use getenv()?
You claim the FreeBSD versions is smaller, but this is synth! 99.99%
of the time the size of synth does not matter. The remaining 0.01% are
doing something very strange, ie running synthetic eCos on a tiny
Linux machine!
As for ftok() i don't see much point in using the FreeBSD version. The
Linux man page tells you what it does, so why not just re-implement it
and save us a big license header.
Andrew