s/qmail
3.3.23
Next generation secure email transport
sqmail-3.3.23
src
timeoutwrite.c
Go to the documentation of this file.
1
#include "
timeoutwrite.h
"
2
#include "select.h"
3
#include "
error.h
"
4
#include "
readwrite.h
"
5
6
int
timeoutwrite
(
int
t,
int
fd
,
char
*
buf
,
int
len
)
7
{
8
fd_set wfds;
9
struct
timeval tv;
10
11
tv.tv_sec = t;
12
tv.tv_usec = 0;
13
14
FD_ZERO(&wfds);
15
FD_SET(fd,&wfds);
16
17
if
(select(fd + 1,(fd_set *) 0,&wfds,(fd_set *) 0,&tv) == -1)
return
-1;
18
if
(FD_ISSET(fd,&wfds))
return
write(fd,buf,len);
19
20
errno
=
error_timeout
;
21
return
-1;
22
}
fd
int fd
Definition:
idedit.c:16
timeoutwrite
int timeoutwrite(int t, int fd, char *buf, int len)
Definition:
timeoutwrite.c:6
error.h
len
unsigned len
Definition:
matchup.c:36
errno
int errno
readwrite.h
buf
unsigned char * buf
Definition:
dns.c:41
error_timeout
int error_timeout
Definition:
error.c:48
timeoutwrite.h
Generated on Sat Jan 12 2019 23:42:28 for s/qmail by
1.8.13