search for: sock_nonblock

Displaying 20 results from an estimated 22 matches for "sock_nonblock".

2015 Feb 09
5
Re: Patchable build problems on OS X 10.10
...col.h" > > > > +/* Fixes for Mac OS X */ > > +#if defined __APPLE__ && defined __MACH__ > > +#include <sys/un.h> > > +#endif > > +#ifndef SOCK_CLOEXEC > > +# define SOCK_CLOEXEC O_CLOEXEC > > +#endif > > +#ifndef SOCK_NONBLOCK > > +# define SOCK_NONBLOCK O_NONBLOCK > > +#endif > > +/* End of fixes for Mac OS X */ > > + > > /* Check minimum required version of libvirt. The libvirt backend > > * is new and not the default, so we can get away with forcing > > * peo...
2019 May 25
2
[PATCH libnbd] states: connect_command: Don't set O_NONBLOCK on socket passed to child.
...t;fcntl.h> #include <errno.h> #include <signal.h> #include <netdb.h> @@ -183,12 +184,12 @@ CONNECT_COMMAND.START: int sv[2]; pid_t pid; + int flags; assert (!h->sock); assert (h->argv); assert (h->argv[0]); - if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0, - sv) == -1) { + if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { SET_NEXT_STATE (%.DEAD); set_error (errno, "socketpair"); return -1; @@ -219,13 +220,27 @@ } /* Parent. */ + close (sv[1]); + h->pid...
2019 May 25
1
Re: [PATCH libnbd] states: connect_command: Don't set O_NONBLOCK on socket passed to child.
...; --- >> generator/states-connect.c | 21 ++++++++++++++++++--- >> 1 file changed, 18 insertions(+), 3 deletions(-) >> > >> assert (!h->sock); >> assert (h->argv); >> assert (h->argv[0]); >> - if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0, >> - sv) == -1) { >> + if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { > > Is it any easier to keep SOCK_NONBLOCK here and then clear O_NONBLOCK in > the child process? It may matter if we try to port to a system that >...
2015 Feb 09
0
Re: Patchable build problems on OS X 10.10
.../* Fixes for Mac OS X */ > > > +#if defined __APPLE__ && defined __MACH__ > > > +#include <sys/un.h> > > > +#endif > > > +#ifndef SOCK_CLOEXEC > > > +# define SOCK_CLOEXEC O_CLOEXEC > > > +#endif > > > +#ifndef SOCK_NONBLOCK > > > +# define SOCK_NONBLOCK O_NONBLOCK > > > +#endif > > > +/* End of fixes for Mac OS X */ > > > + > > > /* Check minimum required version of libvirt. The libvirt backend > > > * is new and not the default, so we can get away...
2019 May 25
1
Interesting libnbd/nbdkit bug
...n and nbdkit is consuming 100% of CPU. In all other respects everything works fine, you can send commands etc. Anyway I tracked the issue down. nbdkit sits in a loop continuously reading stdin, each read(2) call returning EAGAIN. The reason for that is because libnbd opens a socketpair with the SOCK_NONBLOCK option and passes one half directly to the forked subprocess. It's obviously a bug, but I'm not sure if libnbd should be unsetting the SOCK_NONBLOCK option or if nbdkit should be doing it. Maybe both! Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.co...
2015 Feb 05
4
Patchable build problems on OS X 10.10
...10: * It's not possible to build Java bindings with Java 8, because javadoc fails on GuestFS.java with a hundred or so errors. * ruby/Makefile.in assumes a .so extension for the built file, while on Mac DLEXT appears to default to .bundle. * src/launch-libvirt.c uses SOCK_CLOEXEC and SOCK_NONBLOCK which don't exist on Darwin. * src/launch-libvirt.c needs to #include <sys/un.h> for sockaddr_un. The rest of the issues have been mentioned in https://www.redhat.com/archives/libguestfs/2013-October/msg00042.html, and I've reused RWMJ's patches....
2019 May 25
0
Re: [PATCH libnbd] states: connect_command: Don't set O_NONBLOCK on socket passed to child.
...cket along > error paths. > --- > generator/states-connect.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > assert (!h->sock); > assert (h->argv); > assert (h->argv[0]); > - if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0, > - sv) == -1) { > + if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { Is it any easier to keep SOCK_NONBLOCK here and then clear O_NONBLOCK in the child process? It may matter if we try to port to a system that lacks SOCK_CLOEXEC (SOCK_NON...
2019 Oct 18
0
[PATCH libnbd 1/2] states: Don't assume socket address family is always AF_UNIX.
...-git a/generator/states-connect.c b/generator/states-connect.c index 04e894c..d62b0f5 100644 --- a/generator/states-connect.c +++ b/generator/states-connect.c @@ -51,7 +51,8 @@ STATE_MACHINE { int fd; assert (!h->sock); - fd = socket (AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0); + fd = socket (h->connaddr.ss_family, + SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0); if (fd == -1) { SET_NEXT_STATE (%.DEAD); set_error (errno, "socket"); -- 2.23.0
2019 Oct 18
5
[PATCH libnbd 0/2] api: Add support for AF_VSOCK.
This is a series of patches to libnbd and nbdkit adding AF_VSOCK support. On the host side it allows you to start an nbdkit instance which listens on a virtio-vsock socket: $ ./nbdkit -fv --vsock memory 1G ... nbdkit: debug: bound to vsock 2:10809 On the guest side you can then use libnbd to connect to the server: $ ./run nbdsh -c 'h.connect_vsock(2, 10809)' -c
2014 Jan 16
0
Generic UPS driver
...ad(4, "", 4096) = 0 close(4) = 0 munmap(0x7fa313f8d000, 4096) = 0 write(2, " 0.000000\t", 12) = 12 write(2, "debug level is '3'\n", 19) = 19 socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4 connect(4, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4 connect(4, {sa_family=AF_LOCAL, sun_path=&quot...
2013 Nov 08
1
Rsync hanging, even with timeout and contimeout specified
...], NULL, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN, [], SA_RESTORER|SA_NOCLDSTOP, 0x7f4310247450}, NULL, 8) = 0 rt_sigaction(SIGXFSZ, {SIG_IGN, [], SA_RESTORER|SA_NOCLDSTOP, 0x7f4310247450}, NULL, 8) = 0 getcwd("/tmp", 4095) = 5 socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(3) = 0 socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 connect(3, {sa_family=AF_LOCAL, sun_path=&quot...
2015 Feb 06
0
Re: Patchable build problems on OS X 10.10
...ns.h" > #include "guestfs_protocol.h" > > +/* Fixes for Mac OS X */ > +#if defined __APPLE__ && defined __MACH__ > +#include <sys/un.h> > +#endif > +#ifndef SOCK_CLOEXEC > +# define SOCK_CLOEXEC O_CLOEXEC > +#endif > +#ifndef SOCK_NONBLOCK > +# define SOCK_NONBLOCK O_NONBLOCK > +#endif > +/* End of fixes for Mac OS X */ > + > /* Check minimum required version of libvirt. The libvirt backend > * is new and not the default, so we can get away with forcing > * people who want to try it to have a re...
2014 Jan 12
3
Generic UPS driver
On Jan 12, 2014, at 11:07 AM, Ariel Wainer wrote: > On 11/01/14 15:27, Charles Lepple wrote: >> On Jan 10, 2014, at 4:46 PM, Ariel Wainer wrote: >> >>> On 10/01/14 01:53, Charles Lepple wrote: >>>> I am curious about why the Interrupt Out packet is sent by the Windows software if it isn't to turn off the UPS. Is it possible to do some more
2012 May 22
0
[klibc:master] include: [sys/socket.h] define SOMAXCONN
...1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/usr/include/sys/socket.h b/usr/include/sys/socket.h index 38cfef6..3334212 100644 --- a/usr/include/sys/socket.h +++ b/usr/include/sys/socket.h @@ -32,6 +32,9 @@ # define SOCK_NONBLOCK 04000 #endif +/* The maximum backlock queue length. */ +#define SOMAXCONN 128 + #ifndef AF_INET #define AF_UNSPEC 0 #define AF_UNIX 1 /* Unix domain sockets */
2019 Oct 18
0
Re: [PATCH libnbd 2/2] api: Add support for AF_VSOCK.
...er than just compile-time presence of > AF_VSOCK? You can actually test this just by running the following command on the host: $ ./run strace -f -o /tmp/log nbdsh -c 'h.connect_vsock(2, 10809)' The log shows how it fails: 3395572 socket(AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3 ... 3395572 connect(3, {sa_family=AF_VSOCK, sa_data="\0\09*\0\0\2\0\0\0\0\0\0\0"}, 16) = -1 ENODEV (No such device) That's unfortunate as it means we would have to connect to a non-existent socket and determine if it returns ENODEV or ECONNREFUSED (and if it returns something...
2014 Jan 03
1
SSSD and usermod
...lose(4) = 0 mmap(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f96bfdb8000 access("/etc/shadow", F_OK) = 0 access("/etc/gshadow", F_OK) = 0 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4 connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory) close(4) = 0 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4 connect(4, {sa_family=AF_FILE, path="/var...
2011 Jun 28
3
Changes to upscli_connect
Hello, I am currently working on the nut scanner. For detecting available upsd on the network, I rely on upscli_connect. The problem with this function is that it calls a blocking "connect" function. So the nut-scanner is blocked while waiting for the TCP timeout when trying to connect to an IP without upsd available . Since this timeout may be rather long (3 minutes on my host), I
2015 Nov 04
2
Retrieving datas sent by host within the Guest
Hi, I' trying to read datas sent by my KVM host within the Guest. Host send these datas trough a channel UNIX type , by using AF_UNIX socket stuff. If i try to retrive the datas by using such type of thing in the Guest : #define NAME "/dev/virtio-ports/agent" sock = socket(AF_UNIX, SOCK_STREAM, 0); 12 if (sock < 0) { 13 perror("opening stream
2017 Mar 03
2
[PATCH 1/2] Use gnulib set_nonblocking_flag function instead of fcntl.
The previous code: fcntl (fd, F_SETFL, O_NONBLOCK) was technically incorrect, because it would have reset any other flags on the file descriptor. Thanks: Eric Blake --- bootstrap | 1 + daemon/inotify.c | 6 ++++-- lib/conn-socket.c | 21 +++++++++++---------- m4/.gitignore | 9 +++++++++ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git
2019 Oct 18
4
Re: [PATCH libnbd 2/2] api: Add support for AF_VSOCK.
On 10/18/19 10:39 AM, Richard W.M. Jones wrote: > This adds a new API for connecting to AF_VSOCK protocol > (https://wiki.qemu.org/Features/VirtioVsock). > > For example: > > nbd_connect_vsock (nbd, 2, 10809); > > There is no test of this feature because it only works between guest > and host. You cannot start a server and client on the