Re: [PATCHv3 0/4] sys_indirect system call

Eric Dumazet
2007-11-19T14:18:18Z

On Sat, 17 Nov 2007 00:31:36 -0500
Ulrich Drepper <drepper@redhat.com> wrote:

>
> union indirect_params i;
> i.file_flags.flags = O_CLOEXEC;

This setup forbids future addons to file_flags

In three years, when we want to add a new indirect feature to socket()
call, do we need a new indirect2() syscall ?

So I suggest using :

union indirect_params i = {
.file_flags.flags = O_CLOEXEC,
};
fd = syscall (__NR_indirect, &r, &i, sizeof (i));

Or better, you could avoid using 'union indirect_params' in user code, and
only use the substructs for each function.
/* define this in some include file of course */
struct file_flags {
int flags;
};
/* use it */
struct file_flags ff = { .flags = O_CLOEXEC};
fd = syscall (__NR_indirect, &r, &ff, sizeof(ff));

This to avoid to copy to kernel un-necessary data, and permitting futures changes.