vm/qubes-rpc: move set_(non)?block to ioall.c as can be used not only in qrexec

This commit is contained in:
Marek Marczykowski 2012-08-25 01:11:22 +02:00
förälder 373e778646
incheckning bff7ee6f25
2 ändrade filer med 13 tillägg och 0 borttagningar

Visa fil

@ -32,6 +32,17 @@ void perror_wrapper(char * msg)
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)
{

Visa fil

@ -1,3 +1,5 @@
int write_all(int fd, void *buf, int size);
int read_all(int fd, void *buf, int size);
int copy_fd_all(int fdout, int fdin);
void set_nonblock(int fd);
void set_block(int fd);