/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1999-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> *
* *
***********************************************************************/
#include "sftest.h"
int Except;
#if __STD_C
#else
void alrmhandler(sig)
int sig;
#endif
{
if(Except == 0)
{ Except = 2;
alarm(2);
}
else if(Except == 2)
{ twarn("System call was automatically resumed by the OS");
texit(0);
}
}
#if __STD_C
#else
Sfio_t* f;
int type;
#endif
{
return 0;
Except = -1;
return -1;
}
tmain()
{
ssize_t n;
terror("Can't make pipe");
terror("Can't renew stdin");
Except = 0;
alarm(2);
terror("Unexpected data");
terror("Handler wasn't called");
if(Except >= 0)
terror("Exception handler wasn't called1");
Buf[0] = 0;
Except = 0;
alarm(2);
terror("Unexpected data2");
terror("Handler wasn't called2");
if(Except >= 0)
terror("Exception handler wasn't called2");
Buf[0] = 0;
terror("Writing to pipe");
alarm(2);
twarn("Wrong read size(%d) after an interrupt\n", n);
texit(0);
}