190792Sgshapiro/* 2261363Sgshapiro * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers. 390792Sgshapiro * All rights reserved. 490792Sgshapiro * Copyright (c) 1990, 1993 590792Sgshapiro * The Regents of the University of California. All rights reserved. 690792Sgshapiro * 790792Sgshapiro * This code is derived from software contributed to Berkeley by 890792Sgshapiro * Chris Torek. 990792Sgshapiro * 1090792Sgshapiro * By using this file, you agree to the terms and conditions set 1190792Sgshapiro * forth in the LICENSE file which can be found at the top level of 1290792Sgshapiro * the sendmail distribution. 1390792Sgshapiro */ 1490792Sgshapiro 1590792Sgshapiro#include <sm/gen.h> 16266692SgshapiroSM_RCSID("@(#)$Id: fput.c,v 1.21 2013-11-22 20:51:42 ca Exp $") 1790792Sgshapiro#include <string.h> 1890792Sgshapiro#include <errno.h> 1990792Sgshapiro#include <sm/io.h> 2090792Sgshapiro#include <sm/assert.h> 2190792Sgshapiro#include "local.h" 2290792Sgshapiro#include "fvwrite.h" 2390792Sgshapiro 2490792Sgshapiro/* 2590792Sgshapiro** SM_IO_FPUTS -- add a string to the buffer for the file pointer 2690792Sgshapiro** 2790792Sgshapiro** Parameters: 2890792Sgshapiro** fp -- the file pointer for the buffer to be written to 2990792Sgshapiro** timeout -- time to complete the put-string 3090792Sgshapiro** s -- string to be placed in the buffer 3190792Sgshapiro** 3290792Sgshapiro** Returns: 3390792Sgshapiro** Failure: returns SM_IO_EOF 3490792Sgshapiro** Success: returns 0 (zero) 3590792Sgshapiro*/ 3690792Sgshapiro 3790792Sgshapiroint 3890792Sgshapirosm_io_fputs(fp, timeout, s) 3990792Sgshapiro SM_FILE_T *fp; 4090792Sgshapiro int timeout; 4190792Sgshapiro const char *s; 4290792Sgshapiro{ 4390792Sgshapiro struct sm_uio uio; 4490792Sgshapiro struct sm_iov iov; 4590792Sgshapiro 4690792Sgshapiro SM_REQUIRE_ISA(fp, SmFileMagic); 4790792Sgshapiro iov.iov_base = (void *) s; 4890792Sgshapiro iov.iov_len = uio.uio_resid = strlen(s); 4990792Sgshapiro uio.uio_iov = &iov; 5090792Sgshapiro uio.uio_iovcnt = 1; 5190792Sgshapiro return sm_fvwrite(fp, timeout, &uio); 5290792Sgshapiro} 53