lkml.org 
[lkml]   [2008]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] eventfd, signalfd, timerfd, epoll_create w/flags
On Sun, 27 Apr 2008, Ulrich Drepper wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Davide Libenzi wrote:
> > unsigned int oflags_remap(const struct oflags_rmap *m, int n,
> > int f, int *rf)
> > {
> > int i;
> > for (i = 0, *rf = 0; i < n; i++, m++)
> > if (f & m->f) {
> > *rf |= m->of;
> > f &= ~m->f;
> > }
> > return f ? -EINVAL: 0;
> > }
>
> This will be more expensive in terms of code and runtime. Plus: who
> knows whether there will really be other flags which can be used like
> this? I think it's overkill to do this. If at some point there are
> more flags which are handled the same way one could do something like
> this but I don't think it's necessary now.

There are already, not one, not two, not three, but four call sites where
an aweful cut&paste is used to basically do the same thing. And probably
there's another one you likely did for the sockets.




- Davide




\
 
 \ /
  Last update: 2008-04-28 08:09    [W:0.042 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site