This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: FWD: Re: [ECOS] Problems with init_all_network_interfaces
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Nick Garnett <nickg at ecoscentric dot com>
- Cc: Andrew Lunn <andrew dot lunn at ascom dot ch>, eCos Patches <ecos-patches at sources dot redhat dot com>
- Date: Fri, 11 Jul 2003 16:46:55 +0200
- Subject: Re: FWD: Re: [ECOS] Problems with init_all_network_interfaces
- References: <20030711093202.GQ2351@biferten.ma.tech.ascom.ch> <m3r84xrztc.fsf@miso.calivar.com>
> > This patch should solve this problem. socket will return EINVAL.
>
> Actually, I think it would be better to return EPROTONOSUPPORT, which
> is what you would get if there were entries in the table but none of
> them supported the protocol requested.
Humm, POSIX says
int socket(int domain, int type, int protocol);
The socket() function shall fail if:
[EAFNOSUPPORT]
The implementation does not support the specified address family.
[EMFILE]
No more file descriptors are available for this process.
[ENFILE]
No more file descriptors are available for the system.
[EPROTONOSUPPORT]
The protocol is not supported by the address family, or the
protocol is not supported by the implementation.
[EPROTOTYPE]
The socket type is not supported by the protocol.
So for me, EPROTONOSUPPORT is talking about the third parameter,
protocol. ie we have found something that supports the domain and the
type, but not the protocol.
In the case of the bug, we don't even support the domain, so
EAFNOSUPPORT seems more appropriate.
Having said that, i don't really case so long as its something
sensible.
Andrew