This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Split ttyname.c to avoid unnecessary dependencies
- From: Eric Bresie <ebresie at gmail dot com>
- To: newlib at sources dot redhat dot com
- Date: Tue, 24 Feb 2009 06:25:10 -0600
- Subject: Re: Split ttyname.c to avoid unnecessary dependencies
- References: <4993EEC4.4090000@embedded-brains.de>
Shucks...I thought I had sent this comment out some time back and was
wondering why it never showed up...let me try again.
...
Not sure if newlib is trying to stay Unix/POSIX compliant, but
splitting the file might be counter to the standard.See
http://www.opengroup.org/onlinepubs/009695399/functions/ttyname.html
Would an #ifdef _TTYNAME / #ifdef _TTYNAME_R or some such item be
usable allowing on the needed function to be used?
--
Eric Bresie
ebresie@gmail.com
On Thu, Feb 12, 2009 at 3:41 AM, Sebastian Huber
<sebastian.huber@embedded-brains.de> wrote:
> Hi,
>
> the two functions ttyname() and ttyname_r() are currently defined in one file
>
> libc/.c
>
> The ttyname() function needs 1030 bytes of data (with common _PATH_DEV and
> MAXNAMLEN values). This is quite much if you have a system with a small memory
> space. The file should be split up into ttyname.c and ttynaunix/ttynameme_r.c to avoid
> this memory requirement if you only use ttyname_r().
>
> Have a nice day!
>
> Sebastian Huber, Embedded Brains GmbH