Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/tests/sfio/tbadargs.c
1810 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1999-2011 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Glenn Fowler <[email protected]> *
18
* *
19
***********************************************************************/
20
#include "sftest.h"
21
22
int Code_line = 30; /* line number of CALL(sfclose(0)) */
23
24
#if defined(__LINE__)
25
#define CALL(x) ((Code_line = __LINE__), (x))
26
#else
27
#define CALL(x) ((Code_line += 1),(x))
28
#endif
29
30
#if __STD_C
31
void handler(int sig)
32
#else
33
void handler(sig)
34
int sig;
35
#endif
36
{
37
terror("Bad argument handling on code line %d", Code_line);
38
}
39
40
41
tmain()
42
{
43
signal(SIGILL,handler);
44
signal(SIGBUS,handler);
45
signal(SIGSEGV,handler);
46
47
CALL(sfclose(0));
48
CALL(sfclrlock(0));
49
CALL(sfopen(0,0,0));
50
CALL(sfdisc(0,0));
51
CALL(_sffilbuf(0,0));
52
CALL(_sfflsbuf(0,0));
53
CALL(sfgetd(0));
54
CALL(sfgetl(0));
55
CALL(sfgetm(0,0));
56
CALL(sfgetr(0,0,0));
57
CALL(sfgetu(0));
58
CALL(sfmove(0,0,0,0));
59
CALL(sfmutex(0,0));
60
CALL(sfnew(0,0,0,0,0));
61
CALL(sfnputc(0,0,0));
62
CALL(sfopen(0,0,0));
63
CALL(sfpoll(0,0,0));
64
CALL(sfpool(0,0,0));
65
CALL(sfpopen(0,0,0));
66
CALL(sfprintf(0,0));
67
CALL(sfvsprintf(0,0,0,0));
68
CALL(sfsprintf(0,0,0));
69
CALL(sfprints(0));
70
CALL(sfpurge(0));
71
CALL(sfputd(0,0));
72
CALL(sfputl(0,0));
73
CALL(sfputm(0,0,0));
74
CALL(sfputr(0,0,0));
75
CALL(sfputu(0,0));
76
CALL(sfraise(0,0,0));
77
CALL(sfrd(0,0,0,0));
78
CALL(sfread(0,0,0));
79
CALL(sfreserve(0,0,0));
80
CALL(sfresize(0,0));
81
CALL(sfscanf(0,0));
82
CALL(sfvsscanf(0,0,0));
83
CALL(sfsscanf(0,0));
84
CALL(sfseek(0,0,0));
85
CALL(sfset(0,0,0));
86
CALL(sfsetbuf(0,0,0));
87
CALL(sfsetfd(0,0));
88
CALL(sfsize(0));
89
CALL(sfsk(0, 0, 0, 0));
90
CALL(sfstack(0, 0));
91
CALL(sfswap(0, 0));
92
CALL(sfsync(0));
93
CALL(sftell(0));
94
CALL(sftmp(0));
95
CALL(sfungetc(0,0));
96
CALL(sfvprintf(0,0,0));
97
CALL(sfvscanf(0,0,0));
98
CALL(sfwr(0,0,0,0));
99
CALL(sfwrite(0,0,0));
100
101
texit(0);
102
}
103
104