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