8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sendmail / libsm / fput.c
blob6a787758eb781a588bc84b900621f786bd37c8ee
1 /*
2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1990, 1993
5 * The Regents of the University of California. All rights reserved.
7 * This code is derived from software contributed to Berkeley by
8 * Chris Torek.
10 * By using this file, you agree to the terms and conditions set
11 * forth in the LICENSE file which can be found at the top level of
12 * the sendmail distribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
17 #include <sm/gen.h>
18 SM_RCSID("@(#)$Id: fput.c,v 1.18 2001/01/28 00:29:35 ca Exp $")
19 #include <string.h>
20 #include <errno.h>
21 #include <sm/io.h>
22 #include <sm/assert.h>
23 #include "local.h"
24 #include "fvwrite.h"
27 ** SM_IO_FPUTS -- add a string to the buffer for the file pointer
29 ** Parameters:
30 ** fp -- the file pointer for the buffer to be written to
31 ** timeout -- time to complete the put-string
32 ** s -- string to be placed in the buffer
34 ** Returns:
35 ** Failure: returns SM_IO_EOF
36 ** Success: returns 0 (zero)
39 int
40 sm_io_fputs(fp, timeout, s)
41 SM_FILE_T *fp;
42 int timeout;
43 const char *s;
45 struct sm_uio uio;
46 struct sm_iov iov;
48 SM_REQUIRE_ISA(fp, SmFileMagic);
49 iov.iov_base = (void *) s;
50 iov.iov_len = uio.uio_resid = strlen(s);
51 uio.uio_iov = &iov;
52 uio.uio_iovcnt = 1;
53 return sm_fvwrite(fp, timeout, &uio);