Subject: Re: Proposal: socketfrom()
To: None <>
From: Greg A. Woods <>
List: tech-net
Date: 07/05/2007 02:05:11
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Thu, 5 Jul 2007 01:38:05 -0400, Thor Lancelot Simon wrote:
Subject: Proposal: socketfrom()
> I'd like to make it possible to set options on one "template" or "master"
> socket and then have them inherited by children, as listen()/accept() make
> possible for the other direction.  I'm thinking of something along the li=
> of this:
> int socketfrom(int template, int domain, int type, int protocol);

That might be easier to implement inside the kernel, but wouldn't it be
better from a clean API design point of view to have something like a:

	setsockopt_default(int level,
			   int optname,
			   const void *optval,
			   socklen_t optlen);

Which would set the default option(s) for all new sockets created by the
process until the next call to it?

(options would be set back to the system defaults across exec, and
perhaps also when called with all params zeros except "level")

						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <>
Planix, Inc. <>       Secrets of the Weird <>

Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

Version: PGPfreeware 5.0i for non-commercial use
MessageID: uDHnfbeCwZW/5O1nVWbZ30BdDSKcZVCr