/*
* Copyright (c) 2000-2001, 2005, 2006 Proofpoint, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*/
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <string.h>
#include "local.h"
/*
** SM_IO_FLUSH -- flush the buffer for a 'fp' to the "file"
**
** Flush a single file. We don't allow this function to flush
** all open files when fp==NULL any longer.
**
** Parameters:
** fp -- the file pointer buffer to flush
** timeout -- time to complete the flush
**
** Results:
** Failure: SM_IO_EOF and sets errno
** Success: 0 (zero)
*/
int
int SM_NONVOLATILE timeout;
{
int fd;
{
/*
** The file is not opened for writing, so it cannot be flushed
*/
return SM_IO_EOF;
}
/* Now do the flush */
}
/*
** SM_FLUSH -- perform the actual flush
**
** Assumes that 'fp' has been validated before this function called.
**
** Parameters:
** fp -- file pointer to be flushed
** timeout -- max time allowed for flush (milliseconds)
**
** Results:
** Success: 0 (zero)
** Failure: SM_IO_EOF and errno set
**
** Side Effects:
** timeout will get updated with the time remaining (if any)
*/
int
int *timeout;
{
register unsigned char *p;
register int n, t;
int fd;
if ((t & SMWR) == 0)
return 0;
if (t & SMSTR)
{
return 0;
}
return 0;
{
/* can't get an fd, likely internal 'fake' fp */
errno = 0;
fd = -1;
}
/*
** Set these immediately to avoid problems with longjmp and to allow
** exchange buffering (via setvbuf) in user write function.
*/
for (; n > 0; n -= t, p += t)
{
errno = 0; /* needed to ensure EOF correctly found */
/* Call the file type's write function */
if (t <= 0)
{
if (t == 0 && errno == 0)
break; /* EOF found */
{
/* errno set by fp->f_write */
return SM_IO_EOF;
}
t = 0;
}
}
return 0;
}