search for: fd_isset

Displaying 20 results from an estimated 96 matches for "fd_isset".

2013 Mar 07
4
[PATCH 0/4] Small refactorings of the protocol layer.
As the start of work to add remote support, I'm taking a close look at the protocol layer in the library. These are some small cleanups. Rich.
2011 Oct 11
5
[PATCH] libxl: reimplement buffer for bootloading and drop data if buffer is full
...(nfds, &rsel, &wsel, NULL, &wait); if (ret < 0) goto out_err; + if (ret == 0) { + timeout = 1; + continue; + } + timeout = 0; /* Input from xenconsole, read xenconsoled_fd, write bootloader_fd */ if (FD_ISSET(xenconsoled_fd, &rsel)) { + if (xenconsoled_prod == XENCONSOLED_BUF_SIZE) { + if (ioctl(xenconsoled_fd, FIONREAD, &read_ahead) < 0) + goto out_err; + memmove(xenconsoled_buf, &xenconsoled_buf[read_ahead], XENCONSOLED_BUF_SIZ...
2013 Feb 19
13
[PATCH] mini-os: implement poll(2)
...* 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, ignoring PULLHUP + * POLLNVAL */ + _pfd[i].revents |= POLLERR; + continue; + } + if (FD_ISSET(fd, &rfds)) + _pfd[i].revents |= POLLIN; + if (FD_ISSET(fd, &a...
2007 Jan 16
11
[Bug 52] ssh hangs on exit
http://bugzilla.mindrot.org/show_bug.cgi?id=52 dtucker at zip.com.au changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO| |1274 nThis| | ------- You are receiving this mail because: ------- You are the assignee for
2013 Jan 03
20
[PATCH] Switch to poll in xenconsoled's io loop.
...which indicate a possible log reload */ if (ret == -1) { if (errno == EINTR) continue; - dolog(LOG_ERR, "Failure in select: %d (%s)", + dolog(LOG_ERR, "Failure in poll: %d (%s)", errno, strerror(errno)); break; } - if (log_hv && FD_ISSET(xc_evtchn_fd(xce_handle), &readfds)) + if (log_hv && FD_REVENTS(xc_evtchn_fd(xce_handle)) & POLLIN) handle_hv_logs(); if (ret <= 0) continue; - if (FD_ISSET(xs_fileno(xs), &readfds)) + if (FD_REVENTS(xs_fileno(xs)) & POLLIN) handle_xs(); for (d...
2006 Apr 22
2
bug & patch in ServerAliveInterval (openssh 4.3-p2)
...NULL; - else { + else if(tv.tv_sec == 0 && tv.tv_usec == 0) { tv.tv_sec = options.server_alive_interval; tv.tv_usec = 0; tvp = &tv; } ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp); + if(FD_ISSET(connection_out, *readsetp)) { + tv.tv_sec = 0; + tv.tv_usec = 0; + } if (ret < 0) { char buf[100];
2001 Mar 26
1
duplicated lines in serverloop.c? (openssh252p2)
...through the source, and I noticed that the following code appears twice in the file serverloop.c. Is it supposed to, and if not, would there be any ill effect? +289 +290 /* Read and buffer any available stdout data from the program. */ +291 if (!fdout_eof && FD_ISSET(fdout, readset)) { +292 len = read(fdout, buf, sizeof(buf)); +293 if (len < 0 && (errno == EINTR || errno == EAGAIN)) { +294 /* do nothing */ +295 } else if (len <= 0) { +296...
2020 Oct 14
2
Connection hang, can't stop SSH
Using OpenSSH_8.3p1 I had an open (working) connection to some other box; after a bit of inactivity, some device in the middle seems to have forgotten about the TCP connection (NAT) and broke it. I've got an EscapeChar defined, though; so first I tried to send a BREAK and, when that didn't help (TCP already gone, packets get lost!), I tried (just out of curiosity) a Rekey. Now I can see
2002 May 22
2
rsync: race condition can cause loss of diagnostic output
[This is a copy of the contents of Debian bug report #147842.] Package: rsync Version: 2.5.5-0.2 Severity: normal Cause ----- - rsync forks a child which in turn forks a grandchild in main.c:do_recv(). - Diagnostics written by the grandchild need to be read by the child using read_error_fd() to be handled properly (with the end result being that they are seen by the user running rsync). -
2006 Nov 27
5
[Bug 52] ssh hangs on exit
http://bugzilla.mindrot.org/show_bug.cgi?id=52 dtucker at zip.com.au changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #1075 is|0 |1 obsolete| | Attachment #1098 is|0 |1 obsolete|
2012 Mar 12
0
ssh shell spawn
...FD_ZERO (&rd); ? ? ? ? ? FD_ZERO (&wr); ? ? ? ? ? FD_SET (p1[0], &rd); ? ? ? ? ? FD_SET (p2[0], &rd); ? ? ? ? ? FD_SET (fd_c, &rd); ? ? ? ? ? char *b = 0; ? ? ? ? ? int bl, i; ? ? ? ? ? while (select (p2[1] + 1, &rd, &wr, 0, 0)) ? ? ? ? { ? ? ? ? ? char c; ? ? ? ? ? if (FD_ISSET (fd_c, &rd)) ? ? ? ? ? ? { ? ? ? ? ? ? ? for (i = bl = b = 0; 1; i++) ? ? ? ? ? ? { ? ? ? ? ? ? ? char c; ? ? ? ? ? ? ? int ret = recv (fd_c, &c, sizeof (c), 0); ? ? ? ? ? ? ? if (ret == sizeof (c)) ? ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? bl += sizeof (char); ? ? ? ? ? ? ? ? ? b = realloc (b, b...
2019 Aug 20
2
[8.0p1] After the remote ssh command execution, the session does not terminate until an active disconnect
...-19 19:19:39.000000000 -0700 @@ -2103,7 +2103,15 @@ channel_handle_efd_read(struct ssh *ssh, ssize_t len; int r, force; + force = c->detach_close; - force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED; if (c->efd == -1 || (!force && !FD_ISSET(c->efd, readset))) return 1; --- Thanks. Hong.
2020 Feb 26
2
[PATCH] lib: command: switch from select() to poll()
...rrorf (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. */ n = read (cmd->errorfd, buf, BUFSIZ); if (n > 0) @@ -689,20 +692,26 @@ loop (struct command *cmd) else if (n == 0) { if (close (cmd->error...
2012 Dec 13
2
[PATCH 1/2] daemon: NFC Use symbolic names in commandrvf
..."see debug output for details"); } - close (so_fd[0]); - close (se_fd[0]); + close (so_fd[PIPE_READ]); + close (se_fd[PIPE_READ]); waitpid (pid, NULL, 0); if (stdin_pid >= 0) waitpid (stdin_pid, NULL, 0); return -1; } - if (FD_ISSET (so_fd[0], &rset2)) { /* something on stdout */ - r = read (so_fd[0], buf, sizeof buf); + if (FD_ISSET (so_fd[PIPE_READ], &rset2)) { /* something on stdout */ + r = read (so_fd[PIPE_READ], buf, sizeof buf); if (r == -1) { perror ("read"); goto...
2007 Mar 23
7
4.6p1 chan_read_failed error
The 4.6p1 sshd is logging this error during remote commands or file transfers: error: channel 0: chan_read_failed for istate 3 Platform is Solaris 8, 4.6p1 + OpenSSL 0.9.8d. The commands and transfers work correctly, so the error message appears to be spurious. The error message does not appear when processing logins. Otherwise 4.6p1 is running without any apparent problems. This error
2004 Aug 06
2
icecast + irix
...function `FD_ZERO' connection.c:209: `rfds' undeclared (first use in this function) connection.c:213: warning: implicit declaration of function `FD_SET' connection.c:223: warning: implicit declaration of function `select' connection.c:225: warning: implicit declaration of function `FD_ISSET' but i'm still left with: gcc -DHAVE_CONFIG_H -I. -I. -I.. -D_REENTRANT -g -O2 -Wall -c connection.c connection.c: In function `get_connection': connection.c:193: storage size of `tv' isn't known connection.c:223: warning: implicit declaration of function `select&...
2015 Nov 05
0
Is it possible to retrieve Non blocking socket writeable status of a unix channel device ?
Hi, As using a blocking socket for a virtio device channel leads to be blocked if nobody has opened the corresponding /dev/virtio-ports within the Guest , I tried to use a non-blocking socket and to check whether the socket is writeable via FD_ISSET(). I'm wondering why a virtio device channel is always seen as writeable by the Host even if nobody has opened the corresponding /dev/virtio-ports within the Guest ? res= connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)); if (res < 0) { perror(&q...
2012 Sep 25
1
[PATCH] Fix <sys/time.h> for Linux 3.5.1
...es not even define FD_ZERO etc. + Unfortunately, some architectures define the double-underscore ones as inlines, so we can't use a simple #ifdef test. Thus, the only safe option remaining is to #undef the top-level macros. */ @@ -23,6 +25,7 @@ #undef FD_SET #undef FD_CLR #undef FD_ISSET +#undef FD_SETSIZE __extern void *memset(void *, int, size_t); static inline void FD_ZERO(fd_set *__fdsetp) @@ -45,6 +48,8 @@ static inline int FD_ISSET(int __fd, fd_set *__fdsetp) (__fd % BITS_PER_LONG)) & 1; } +#define FD_SETSIZE __FD_SETSIZE + __extern int gettimeofday(struct time...
2012 Oct 01
0
[klibc:master] include: [sys/time.h] fix for Linux 3.5.1
...gt; --- usr/include/sys/time.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/usr/include/sys/time.h b/usr/include/sys/time.h index 7a2f8b9..98497e7 100644 --- a/usr/include/sys/time.h +++ b/usr/include/sys/time.h @@ -23,6 +23,7 @@ #undef FD_SET #undef FD_CLR #undef FD_ISSET +#undef FD_SETSIZE __extern void *memset(void *, int, size_t); static inline void FD_ZERO(fd_set *__fdsetp) @@ -45,6 +46,8 @@ static inline int FD_ISSET(int __fd, fd_set *__fdsetp) (__fd % BITS_PER_LONG)) & 1; } +#define FD_SETSIZE __FD_SETSIZE + __extern int gettimeofday(struct time...
2006 Sep 06
7
[RFC PATCH] allow connecting to xenconsole from remote hosts
...+ FD_ZERO(&wfds); + FD_SET(conspty, &wfds); + FD_SET(outfd, &wfds); + + max = (conspty | infd | outfd) + 1; + + ret = select(max, &rfds, &wfds, NULL, NULL); + if (ret == -1) { if (errno == EINTR || errno == EAGAIN) { continue; } - return -1; - } - - if (FD_ISSET(STDIN_FILENO, &fds)) { - ssize_t len; - char msg[60]; - - len = read(STDIN_FILENO, msg, sizeof(msg)); - if (len == 1 && msg[0] == ESCAPE_CHARACTER) { + return -errno; + } + + if (FD_ISSET(infd, &rfds)) { + ret = handle_read_fd(infd, &console, NULL); + if (ret &lt...