2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
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
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.
16 SM_RCSID("@(#)$Id: put.c,v 1.27 2001/12/19 05:19:35 ca Exp $")
20 #include <sm/assert.h>
21 #include <sm/errstring.h>
22 #include <sm/string.h>
27 ** SM_IO_PUTC -- output a character to the file
29 ** Function version of the macro sm_io_putc (in <sm/io.h>).
32 ** fp -- file to output to
33 ** timeout -- time to complete putc
34 ** c -- int value of character to output
37 ** Failure: returns SM_IO_EOF _and_ sets errno
38 ** Success: returns sm_putc() value.
45 sm_io_putc(fp
, timeout
, c
)
50 SM_REQUIRE_ISA(fp
, SmFileMagic
);
56 return sm_putc(fp
, timeout
, c
);
61 ** SM_PERROR -- print system error messages to smioerr
64 ** s -- message to print
74 int save_errno
= errno
;
76 if (s
!= NULL
&& *s
!= '\0')
77 (void) sm_io_fprintf(smioerr
, SM_TIME_DEFAULT
, "%s: ", s
);
78 (void) sm_io_fprintf(smioerr
, SM_TIME_DEFAULT
, "%s\n",
79 sm_errstring(save_errno
));