/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#include "sfhdr.h"
/* Synchronize data in buffers with the file system.
** If f is nil, all streams are sync-ed
**
** Written by Kiem-Phong Vo.
*/
#if __STD_C
static int _sfall(void)
#else
static int _sfall()
#endif
{
{ /* find the next legitimate pool */
break;
/* walk the streams for _Sfpool only */
{ count += 1;
f = p->sf[n];
goto did_sync;
if(SFFROZEN(f))
continue;
goto did_sync;
goto did_sync;
goto did_sync;
if(sfsync(f) < 0)
rv = -1;
nsync += 1;
}
}
break;
}
return rv;
}
#if __STD_C
#else
int sfsync(f)
#endif
{
SFMTXDECL(f);
if(!(origf = f) )
return _sfall();
rv = 0;
goto done;
{ rv = -1;
goto done;
}
for(; f; f = f->push)
{
/* pretend that this stream is not on a stack */
/* these streams do not need synchronization */
goto next;
{ /* sync the buffer, make sure pool don't move */
rv = -1;
{ /* realize a previously created hole of 0's */
}
}
{ /* make sure the file pointer is at the right place */
}
}
next:
}
done:
}