/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-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> *
* *
***********************************************************************/
#pragma prototyped
#include "cslib.h"
#if _socket_peek && !CS_LIB_SOCKET
#endif
#if _stream_peek && !CS_LIB_STREAM
#include <stropts.h>
#endif
/*
* peek up to siz chars from fd into buf
* -1 returned if fd not peekable
*
* NOTE: cspeek() caches the peek state of fd
* call cspeek(-1,...) to flush the cache
*/
{
register int n;
#if _stream_peek
#endif
if (fd == -1)
{
#if _stream_peek
#endif
#if _socket_peek
#endif
return -1;
}
#if _stream_peek
{
{
return n;
}
}
#endif
#if _socket_peek
{
{
return n;
}
}
#endif
return -1;
}
{
}