lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84a01a8b0903271555i7a4fea50nd95009539aa2f94d@mail.gmail.com>
Date:	Fri, 27 Mar 2009 23:55:56 +0100
From:	nicolas sitbon <nicolas.sitbon@...il.com>
To:	Michael Tokarev <mjt@....msk.ru>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: epoll_ctl and const correctness

Do you read my post? there is a confusion, my question was first : why
the structure isn't const? and you answer me. ok. second, I asked if
the kernel keep track of this structure, that is, it keeps a pointer
on it for doing his job? according to your last answer, no. last
question : why the size type of the first parameter of epoll_create is
int and not size_t? no answer for the moment.

2009/3/27 Michael Tokarev <mjt@....msk.ru>:
> nicolas sitbon wrote:
>>
>> I was looking at libevent of niels provos, and even him, is apparently
>> doing a mistake :
>>
>> static int
>> epoll_add(void *arg, struct event *ev)
>> {
>>        struct epollop *epollop = arg;
>>        struct epoll_event epev = {0, {0}};
>>
>>        /* ... some code here ... */
>>        if (epoll_ctl(epollop->epfd, op, ev->ev_fd, &epev) == -1)
>>                        return (-1);
>>
>>        /* Update events responsible */
>>        if (ev->ev_events & EV_READ)
>>                evep->evread = ev;
>>        if (ev->ev_events & EV_WRITE)
>>                evep->evwrite = ev;
>>
>>        return (0);
>> }
>>
>> the structure pointed to by &epev is allocated on the stack, so how
>> the kernel could keep track of it?
>
> I've no idea what are you talking about and what exactly
> is your problem.  Both the examples (one at cplayer.org and
> another above) gives correct usage of epoll.  If you don't
> understand it, well, I'd suggest reading some documentation
> first, maybe in kernel, maybe in glibc, maybe numerous
> available on the net.  And all the numerous examples too,
> which you quote as, for some reason, wrong.
>
> /mjt
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ