vm/qubes-rpc: move set_(non)?block to ioall.c as can be used not only in qrexec
This commit is contained in:
parent
e03eab7137
commit
77b2758c93
@ -109,18 +109,6 @@ int write_stdin(int fd, int client_id, char *data, int len,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_nonblock(int fd)
|
|
||||||
{
|
|
||||||
int fl = fcntl(fd, F_GETFL, 0);
|
|
||||||
fcntl(fd, F_SETFL, fl | O_NONBLOCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_block(int fd)
|
|
||||||
{
|
|
||||||
int fl = fcntl(fd, F_GETFL, 0);
|
|
||||||
fcntl(fd, F_SETFL, fl & ~O_NONBLOCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Data feed process has exited, so we need to clear all control structures for
|
Data feed process has exited, so we need to clear all control structures for
|
||||||
the client. However, if we have buffered data for the client (which is rare btw),
|
the client. However, if we have buffered data for the client (which is rare btw),
|
||||||
|
@ -32,6 +32,17 @@ void perror_wrapper(char * msg)
|
|||||||
errno=prev;
|
errno=prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_nonblock(int fd)
|
||||||
|
{
|
||||||
|
int fl = fcntl(fd, F_GETFL, 0);
|
||||||
|
fcntl(fd, F_SETFL, fl | O_NONBLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_block(int fd)
|
||||||
|
{
|
||||||
|
int fl = fcntl(fd, F_GETFL, 0);
|
||||||
|
fcntl(fd, F_SETFL, fl & ~O_NONBLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
int write_all(int fd, void *buf, int size)
|
int write_all(int fd, void *buf, int size)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
int write_all(int fd, void *buf, int size);
|
int write_all(int fd, void *buf, int size);
|
||||||
int read_all(int fd, void *buf, int size);
|
int read_all(int fd, void *buf, int size);
|
||||||
int copy_fd_all(int fdout, int fdin);
|
int copy_fd_all(int fdout, int fdin);
|
||||||
|
void set_nonblock(int fd);
|
||||||
|
void set_block(int fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user