1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2006,2008 Oracle. All rights reserved. 5 * 6 * $Id: fwrite.c,v 1.5 2008/01/08 20:58:44 bostic Exp $ 7 */ 8 9#include "db_config.h" 10 11#include "db_int.h" 12 13/* 14 * fwrite -- 15 * 16 * PUBLIC: #ifndef HAVE_FWRITE 17 * PUBLIC: size_t fwrite __P((const void *, size_t, size_t, FILE *)); 18 * PUBLIC: #endif 19 */ 20size_t 21fwrite(buf, size, count, fp) 22 const void *buf; 23 size_t size, count; 24 FILE *fp; 25{ 26 if (fp == stderr) { 27 DBGPRINTF("%.*s", (int)count, buf); 28 return (size * count); 29 } else 30 return ((size_t)IFILE_Write(fp, buf, size * count) / size); 31} 32