lkml.org 
[lkml]   [2007]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 0/4] sys_indirect system call
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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-19 15:21    [W:0.071 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site