2017-10-21 18:40:19 -05:00
|
|
|
/* Deviance Test 17.5.0.1: Ensure illegal parameters passed to fseek are */
|
|
|
|
/* detected */
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2022-10-17 17:50:42 -05:00
|
|
|
int main (void)
|
2017-10-21 18:40:19 -05:00
|
|
|
{
|
|
|
|
FILE *f1;
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
i = fseek (f1, 10L, SEEK_SET); /* try to seek on unopened stream */
|
|
|
|
if (!i)
|
|
|
|
goto Fail;
|
|
|
|
i = fseek (f1, 10L, SEEK_CUR);
|
|
|
|
if (!i)
|
|
|
|
goto Fail;
|
|
|
|
i = fseek (f1, 10L, SEEK_END);
|
|
|
|
if (!i)
|
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
printf ("Passed Deviance Test 17.5.0.1\n");
|
2022-10-17 17:50:42 -05:00
|
|
|
return 0;
|
2017-10-21 18:40:19 -05:00
|
|
|
|
|
|
|
Fail:
|
|
|
|
printf ("Failed Deviance Test 17.5.0.1\n");
|
|
|
|
}
|