On Wed, 4 Aug 1999, Brian F. Feldman wrote:
> On Tue, 3 Aug 1999, Mike Smith wrote:
>
> > > Speaking of the jail() syscall -- it really needs to be revamped a
> > > little before people really start using it wholeheartedly. The size
> > > of the jail structure needs to be passed in the syscall to allow backwards
> > > compatibility when things change such as, for example, the size of the
> > > IP address.
> >
> > Actually, with interfaces like this you should generally pass a pointer
> > to the structure in userspace, and stick a version number constant in
> > the beginning of the structure. The size is often not enough of a
> > determining factor...
>
> Actually, the structure shouldn't change size because it should be
> using a sockaddr.
The argument for versioning is not simply because the size of ip_number
might change (it should be a sockaddr) but because other fields might be
added or removed. To avoid allocating a new syscall whenever this happens,
the structure should be versioned.
Putting sizeof(whatever) at the beginning of the structure works
surprisingly well as a versioning system.
--
Doug Rabson Mail: [EMAIL PROTECTED]
Nonlinear Systems Ltd. Phone: +44 181 442 9037
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message