Displaying 20 results from an estimated 209 matches for "revent".
Did you mean:
event
2019 Jul 17
2
[PATCH libnbd v2] examples: Include an example of integrating with glib main loop.
This is working now, and incorporates all of the changes in Eric's
review, *except* that it still doesn't retire commands (although this
seems to make no obvious difference, except possibly a performance and
memory impact).
Rich.
2020 Feb 26
2
[PATCH] lib: command: switch from select() to poll()
...r = select (maxfd+1, &rset2, NULL, NULL, NULL);
+ r = poll (fds, 2, -1);
if (r == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
- perrorf (cmd->g, "select");
+ perrorf (cmd->g, "poll");
+ return -1;
+ }
+ if (fds[0].revents & POLLERR || fds[1].revents & POLLERR) {
+ perrorf (cmd->g, "poll");
return -1;
}
- if (cmd->errorfd >= 0 && FD_ISSET (cmd->errorfd, &rset2)) {
+ if (fds[0].revents & POLLIN) {
/* Read output and send it to the log. */...
2013 Feb 19
13
[PATCH] mini-os: implement poll(2)
...> writefds
+ * POLL* -> none
+ */
+ if (_pfd[i].events & POLLIN)
+ FD_SET(fd, &rfds);
+ if (_pfd[i].events & POLLOUT)
+ FD_SET(fd, &wfds);
+ /* always set exceptfds */
+ FD_SET(fd, &efds);
+ _pfd[i].revents = 0;
+ if (fd > max_fd)
+ max_fd = fd;
+ }
+
+ ret = select(max_fd+1, &rfds, &wfds, &efds, timeo);
+
+ for (i = 0; i < _nfds; i++) {
+ fd = _pfd[i].fd;
+ if (FD_ISSET(fd, &efds)) {
+ /* anything bad happens we set POLLERR,...
2020 Feb 26
1
Re: [PATCH] lib: command: switch from select() to poll()
...> > if (r == -1) {
> > if (errno == EINTR || errno == EAGAIN)
> > continue;
> > - perrorf (cmd->g, "select");
> > + perrorf (cmd->g, "poll");
> > + return -1;
> > + }
> > + if (fds[0].revents & POLLERR || fds[1].revents & POLLERR) {
> > + perrorf (cmd->g, "poll");
> > return -1;
> > }
> >
> > - if (cmd->errorfd >= 0 && FD_ISSET (cmd->errorfd, &rset2)) {
> > + if (fds[0].revents &...
2019 Jul 17
0
[PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...+ DEBUG (source, "calling connected_callback");
+ source->connected_callback (source);
+ source->called_connected_callback = true;
+ }
+
+ return FALSE;
+}
+
+static gboolean
+check (GSource *sp)
+{
+ struct NBDSource *source = (struct NBDSource *) sp;
+ int dir;
+ int revents;
+
+ if (!source->tag)
+ return FALSE;
+
+ revents = g_source_query_unix_fd ((GSource *) source, source->tag);
+ dir = nbd_aio_get_direction (source->nbd);
+
+ DEBUG (source, "check: direction = 0x%x%s%s, revents = 0x%x%s%s",
+ dir,
+ dir & LIBNBD_AIO_...
2019 Jun 04
0
[PATCH libnbd v2 1/4] examples, tests: Remove want_to_send / ready logic, increase limit on cmds in flight.
...to start with a limit of 16 requests in
-flight (per NBD connection), and measure how adjusting the limit up
-and down affects performance for your local configuration.
+some number. Libnbd will queue commands in the handle even if it
+cannot write them to the server, so this limit is largely to prevent a
+backlog of commands from consuming too much memory. It is suggested
+to start with a limit of 64 requests in flight (per NBD connection),
+and measure how adjusting the limit up and down affects performance
+for your local configuration.
There is a full example using multiple in-flight reque...
2019 Jul 15
0
[PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...t;);
+
+ return FALSE;
+}
+
+static gboolean
+check (GSource *sp)
+{
+ struct NBDSource *source = (struct NBDSource *) sp;
+ int dir;
+
+ if (!source->poll_registered)
+ return FALSE;
+
+ dir = nbd_aio_get_direction (source->nbd);
+
+ DEBUG (source, "check: direction = 0x%x%s%s, revents = 0x%x%s%s",
+ dir,
+ dir & LIBNBD_AIO_DIRECTION_READ ? " READ" : "",
+ dir & LIBNBD_AIO_DIRECTION_WRITE ? " WRITE" : "",
+ source->pollfd.revents,
+ source->pollfd.revents & G_IO_IN ? " G_I...
2019 Jul 15
2
[PATCH libnbd] examples: Include an example of integrating with the glibc main loop.
** NOT WORKING **
This patch shows how to integrate libnbd and the glib main loop.
Posted mainly as a point of discussion as it doesn't quite work yet.
Rich.
2014 Jan 04
1
sudo issues after upgrading to samba/winbind 4.0.13 on Debian Wheezy
...flags O_RDWR)
fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
connect(4, {sa_family=AF_FILE, path="/var/run/samba/winbindd/pipe"}, 110) = 0
poll([{fd=4, events=POLLIN|POLLOUT|POLLHUP}], 1, -1) = 1 ([{fd=4,
revents=POLLOUT}])
write(4, "0\10\0\0\0\0\0\0\0\0\0\0\17\34\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
2096) = 2096
poll([{fd=4, events=POLLIN|POLLHUP}], 1, 5000) = 1 ([{fd=4, revents=POLLIN}])
read(4, "\250\r\0\0\2\0\0\0\33\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
3496) = 349...
2015 Apr 13
3
[Compile Issue] netcat.c on HP NonStop
Greetings,
I am porting the openssh-portable 6.8 release to the HP NonStop (NSE)
platform. Prior versions were no real problem, with minor tweeks. However,
with the inclusion of regress/netcat.c, which depends on arpa/telnet.h, we
have an issue. Unfortunately, the platform does not have this file, nor
anything like it - telnet is done rather differently. We do have a version
of netcat (0.7.1
2020 Feb 26
0
Re: [PATCH] lib: command: switch from select() to poll()
...NULL);
> + r = poll (fds, 2, -1);
> if (r == -1) {
> if (errno == EINTR || errno == EAGAIN)
> continue;
> - perrorf (cmd->g, "select");
> + perrorf (cmd->g, "poll");
> + return -1;
> + }
> + if (fds[0].revents & POLLERR || fds[1].revents & POLLERR) {
> + perrorf (cmd->g, "poll");
> return -1;
> }
>
> - if (cmd->errorfd >= 0 && FD_ISSET (cmd->errorfd, &rset2)) {
> + if (fds[0].revents & POLLIN) {
> /* Read...
2014 Feb 22
0
Dovecot / Postfix and the quota-status
...n advance for your help,
Nathan
=> Postfix trace INET Call
**************************
connect(21, {sa_family=AF_INET, sin_port=htons(12340),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in
progress)
poll([{fd=21, events=POLLOUT}], 1, 100000) = 1 ([{fd=21,
revents=POLLOUT}])
getsockopt(21, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
fcntl(21, F_GETFL) = 0x802 (flags
O_RDWR|O_NONBLOCK)
fcntl(21, F_SETFL, O_RDWR) = 0
fcntl(21, F_GETFD) = 0
fcntl(21, F_SETFD, FD_CLOEXEC) = 0
epoll_ctl(11, EPOLL_CTL_ADD,...
2019 May 31
4
[libnbd] Simultaneous read and write
...s, do that here. */
dir = nbd_aio_get_direction (nbd);
pollfd[0].fd = fd;
pollfd[0].events = 0;
if (dir & LIBNBD_AIO_DIRECTION_READ) pollfd[0].events |= POLLIN;
if (dir & LIBNBD_AIO_DIRECTION_WRITE) pollfd[0].events |= POLLOUT;
poll (pollfd, 1, -1);
if (pollfd[0].revents & LIBNBD_AIO_DIRECTION_READ)
nbd_aio_notify_read ();
else if (pollfd[0].revents & LIBNBD_AIO_DIRECTION_WRITE)
nbd_aio_notify_write ();
}
----------------------------------------------------------------------
The above code is of course assuming a single thread. But to...
2004 Mar 26
1
nmbd dying
...in the logs and a PS shows a nmb
process still running.
This last time around, I had a ptrace running on both nmbd processes and found
that the parent process was the one still running, but the child process
had died. Here's the end of the ptrace of the child:
poll([{fd=9, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
ioctl(9, FIONREAD, [81]) = 0
recvfrom(9, "\t\1\201\200\0\1\0\2\0\0\0\0\vBORDER-ACCT\tbordere"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, [16]) = 81
close(9) = 0
writ...
2023 Aug 30
2
[libnbd PATCH 0/2] (Attempt to) fix Rust on BSD-based builds
I managed to get a build of the async Rust handle compiling on FreeBSD
(although the cirrus CI appears to not actually run 'make check' on
non-Linux machines, at least when run on my fork):
https://gitlab.com/ebblake/libnbd/-/jobs/4985192286
However, I'd really like Tage's review on patch 2 to see if my Rust
makes sense.
Eric Blake (2):
maint: Favor 4-space indent in .rs files
2019 May 31
0
[libnbd] Simultaneous read and write
...nbd_aio_get_direction (nbd);
> pollfd[0].fd = fd;
> pollfd[0].events = 0;
> if (dir & LIBNBD_AIO_DIRECTION_READ) pollfd[0].events |= POLLIN;
> if (dir & LIBNBD_AIO_DIRECTION_WRITE) pollfd[0].events |= POLLOUT;
> poll (pollfd, 1, -1);
> if (pollfd[0].revents & LIBNBD_AIO_DIRECTION_READ)
Rather, if (pollfd[0].revents & POLLIN && dir & LIBNBD_AIO_DIRECTION_READ)
> nbd_aio_notify_read ();
> else if (pollfd[0].revents & LIBNBD_AIO_DIRECTION_WRITE)
and again
> nbd_aio_notify_write ();
> }
or in the...
2019 Jun 27
0
[libnbd PATCH 2/2] poll: Improve our interface
...han being
+intended as something you would use.";
};
"aio_connect", {
@@ -1838,7 +1846,7 @@ come from some other means such as C<nbd_aio_connect>.
We are expected next to read from the server. If using L<poll(2)>
you would set C<events = POLLIN>. If C<revents> returns C<POLLIN>
-you would then call C<nbd_aio_notify_read>.
+or C<POLLHUP> you would then call C<nbd_aio_notify_read>.
Note that once libnbd reaches C<nbd_aio_is_ready>, this direction is
returned even before a command is issued via C<nbd_aio_pwrite> a...
2019 Jul 17
2
Re: [PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...gitignore | 1 +
> README | 2 +
> configure.ac | 9 +
> examples/Makefile.am | 22 ++
> examples/glib-main-loop.c | 511 ++++++++++++++++++++++++++++++++++++++
> 5 files changed, 545 insertions(+)
Looks good.
>
> + revents = g_source_query_unix_fd ((GSource *) source, source->tag);
> +
> + DEBUG (source, "dispatch: revents = 0x%x%s%s",
> + revents,
> + revents & G_IO_IN ? " G_IO_IN" : "",
> + revents & G_IO_OUT ? " G_IO_OUT" :...
2019 Aug 14
0
[PATCH libnbd 3/3] python: Add test for doing asynch copy from one handle to another.
...if dst.aio_get_direction () & nbd.AIO_DIRECTION_READ:
+ devents += select.POLLIN
+ if dst.aio_get_direction () & nbd.AIO_DIRECTION_WRITE:
+ devents += select.POLLOUT
+ poll.register (sfd, sevents)
+ poll.register (dfd, devents)
+ for (fd, revents) in poll.poll ():
+ # The direction of each handle can change since we
+ # slept in the select.
+ if fd == sfd and revents & select.POLLIN and \
+ src.aio_get_direction () & nbd.AIO_DIRECTION_READ:
+ src.aio_notify_read ()
+...
2019 Jun 27
3
[libnbd PATCH 0/2] socket handling cleanups
While working on a new test of what happens when the server goes away
while commands are in flight, I managed to hit a race where I hit
death from SIGPIPE instead of a clean transition to the DEAD state. I
also found myself wanting to use nbd_poll from the test, but with a
way to distinguish between the state machine progressing vs. hanging.
Eric Blake (2):
socket: Avoid SIGPIPE where possible