/***********************************************************************
* *
* 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"
/* Get the size of a stream.
**
** Written by Kiem-Phong Vo.
*/
#if __STD_C
#else
Sfio_t* f;
#endif
{
Sfoff_t s;
SFMTXDECL(f);
{ SFSTRSIZE(f);
SFMTXRETURN(f, f->extent);
}
SFLOCK(f,0);
s = f->here;
if(f->extent >= 0)
break;
{ Sfoff_t e;
f->extent = e;
}
#if _sys_stat
else
f->extent = -1;
}
#endif
}
}
{ /* buffered data is known to be invalid */
#ifdef MAP_TYPE
}
#endif
}
if(f->here < 0)
f->extent = -1;
if((s = f->extent) >= 0)
{ if(f->flags&SF_APPENDWR)
if(s < f->extent)
s = f->extent;
}
}
SFOPEN(f,0);
SFMTXRETURN(f, s);
}