190792Sgshapiro/*
2261194Sgshapiro * 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>
16266527SgshapiroSM_RCSID("@(#)$Id: rewind.c,v 1.19 2013-11-22 20:51:43 ca Exp $")
1790792Sgshapiro#include <errno.h>
1890792Sgshapiro#include <sm/io.h>
1990792Sgshapiro#include <sm/assert.h>
2090792Sgshapiro#include "local.h"
2190792Sgshapiro
2290792Sgshapiro/*
2390792Sgshapiro**  SM_IO_REWIND -- rewind the file
2490792Sgshapiro**
2590792Sgshapiro**	Seeks the file to the begining and clears any outstanding errors.
2690792Sgshapiro**
2790792Sgshapiro**	Parameters:
2890792Sgshapiro**		fp -- the flie pointer for rewind
2990792Sgshapiro**		timeout -- time to complete the rewind
3090792Sgshapiro**
3190792Sgshapiro**	Returns:
3290792Sgshapiro**		none.
3390792Sgshapiro*/
3490792Sgshapiro
3590792Sgshapirovoid
3690792Sgshapirosm_io_rewind(fp, timeout)
3790792Sgshapiro	register SM_FILE_T *fp;
3890792Sgshapiro	int timeout;
3990792Sgshapiro{
4090792Sgshapiro	SM_REQUIRE_ISA(fp, SmFileMagic);
4190792Sgshapiro	(void) sm_io_seek(fp, timeout, 0L, SM_IO_SEEK_SET);
4290792Sgshapiro	(void) sm_io_clearerr(fp);
4390792Sgshapiro	errno = 0;      /* not required, but seems reasonable */
4490792Sgshapiro}
45