Postfix3.3.1
dummy_write.c
[詳解]
1 /*++
2 /* NAME
3 /* dummy_write 3
4 /* SUMMARY
5 /* dummy write operation
6 /* SYNOPSIS
7 /* #include <iostuff.h>
8 /*
9 /* ssize_t dummy_write(fd, buf, buf_len, timeout, context)
10 /* int fd;
11 /* void *buf;
12 /* size_t len;
13 /* int timeout;
14 /* void *context;
15 /* DESCRIPTION
16 /* dummy_write() implements a data sink without side effects.
17 /*
18 /* Arguments:
19 /* .IP fd
20 /* File descriptor whose value is logged when verbose logging
21 /* is turned on.
22 /* .IP buf
23 /* Write buffer pointer. Not used.
24 /* .IP buf_len
25 /* Write buffer size. Its value is logged when verbose logging is
26 /* turned on.
27 /* .IP timeout
28 /* The deadline in seconds. Not used.
29 /* .IP context
30 /* Application context. Not used.
31 /* DIAGNOSTICS
32 /* None.
33 /* LICENSE
34 /* .ad
35 /* .fi
36 /* The Secure Mailer license must be distributed with this software.
37 /* AUTHOR(S)
38 /* Wietse Venema
39 /* IBM T.J. Watson Research
40 /* P.O. Box 704
41 /* Yorktown Heights, NY 10598, USA
42 /*--*/
43 
44 /* System library. */
45 
46 #include <sys_defs.h>
47 
48 /* Utility library. */
49 
50 #include <msg.h>
51 #include <iostuff.h>
52 
53 /* dummy_write - dummy write operation */
54 
55 ssize_t dummy_write(int fd, void *unused_buf, size_t len,
56  int unused_timeout, void *unused_context)
57 {
58  if (msg_verbose)
59  msg_info("dummy_write: fd %d, len %lu", fd, (unsigned long) len);
60  return (len);
61 }
int msg_verbose
Definition: msg.c:177
ssize_t dummy_write(int fd, void *unused_buf, size_t len, int unused_timeout, void *unused_context)
Definition: dummy_write.c:55
void msg_info(const char *fmt,...)
Definition: msg.c:199