This is the mail archive of the
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> <email@example.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:
The implementation does not support the specified address family.
No more file descriptors are available for this process.
No more file descriptors are available for the system.
The protocol is not supported by the address family, or the
protocol is not supported by the implementation.
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