/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1999-2012 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"
static int Write_error = 0;
#if __STD_C
#else
Sfio_t* f;
int type;
#endif
{
Write_error = 1;
return 0;
}
tmain()
{
Sfio_t *r, *w;
char* s;
alarm(10);
{ int i, n, rv;
for(i = 0; i < n; ++i)
terror("Failed to read from stdin");
terror("Failed to write rv=%d stdin=%d",
}
texit(0);
}
terror("Opening pipes");
terror("Opening write stream");
terror("Opening read stream");
terror("sfputr failed");
terror("sfgetr failed");
if(sfclose(r) < 0)
terror("sfclose failed closing read stream");
terror("sfputr failed2");
if(Write_error)
terror("Write exception should not have been raised");
if(sfclose(w) >= 0)
terror("sfclose should have failed closing write stream");
if(!Write_error)
terror("Write exception did not get raised");
{ int i;
terror("Bad signal handler for SIGPIPE");
Write_error = 0;
for(i = 0; i < N_STR*10; ++i)
terror("Writing to coprocess1");
sfsync(w);
i = sffileno(w);
if (i != sffileno(w))
for(i = 0; i < N_STR; ++i)
terror("Reading coprocess [%s]", s);
terror("sfgetr should have failed");
terror("Writing to coprocess2");
if(Write_error)
terror("Write exception should not have been raised yet");
if(sfclose(w))
terror("sfclose should not have returned error status");
if(!Write_error)
terror("Write exception should have been raised");
}
terror("SIGPIPE handler should have been SIG_DFL");
/* test for stdio signal handling behavior */
terror("SIGPIPE handler should have been SIG_DFL");
texit(0);
}