This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: newlib and the use of fcntl by java
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Anthony Green <green at redhat dot com>
- Cc: Richard dot Earnshaw at arm dot com, java at gcc dot gnu dot org, newlib at sources dot redhat dot com
- Date: Tue, 17 Sep 2002 18:27:15 +0100
- Subject: Re: newlib and the use of fcntl by java
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> On Tue, 2002-09-17 at 06:38, Richard Earnshaw wrote:
> > Hmm, it appears that java is making use of the fcntl function in newlib
> > (or at least, it is trying to). This is a problem, since most embedded
> > targets don't provide this function. The function fcntl always exists in
> > newlib's libc.a, but on most targets it will call a non-existent function
> > _fcntl which causes a link error.
>
> I have a patch which adds _fcntl for the ARM newlib port. It was even
> approved, but, being the bad hacker-citizen that I am, it was never
> committed.
>
> http://sources.redhat.com/ml/newlib/2002/msg00105.html
>
> However, I'll note that adding a dummy _fcntl (like in my patch) wasn't
> one of your suggested fixes. I believe syscalls contains other dummy
> implementations - so it seemed like the thing to do. What do you think?
>
> Thanks,
>
> AG
>
>
The problem I see with providing a default that doesn't do the right thing
(TM) is that an application can then get confused, since it made the call
but the effects didn't happen as expected. If we can't do what's
required, I'm not sure we should quietly ignore things. (Even setting
errno and returning -1 might not be enough.)
R.