Resolve many build warnings
[oweals/cde.git] / cde / programs / dtksh / ksh93 / src / lib / libast / feature / lib
1 cmd     universe
2 hdr     dirent,filio,jioctl,locale,mman,ndir,utime,vfork
3 dat     _tzname,tzname
4 lib     _cleanup,BSDsetpgrp,atexit,bcopy,bzero,dirread,dup2,fchmod
5 lib     fcntl,fnmatch,fork,getdents,getdirentries,getdtablesize,getgroups
6 lib     getpagesize,getrlimit,getuniverse,index,killpg,link,localeconv,lstat
7 lib     mbtowc,memccpy
8 lib     memchr,memcmp,memcpy,memdup,memmove,memset,mkdir,mkfifo,mknod,mktemp
9 lib     mount,on_exit,onexit,opendir,pathconf,readlink,remove,rename,rindex
10 lib     rmdir,rewinddir,setlocale,setpgid,setpgrp,setpgrp2,setreuid,setsid
11 lib     setuid,sigaction,sigprocmask,sigsetmask,sigunblock,sigvec
12 lib     socketpair,spawnve,strchr,strcoll,strdup,strerror,strrchr
13 lib     strtod,strtol,strtoul,strxfrm
14 lib     symlink,sysconf,telldir,tmpnam,tzset,universe,unlink,utime
15 lib     vfork,wait2,wait3,wait4,waitpid
16 lib     execve,pcreateve,NutForkExecve
17 mem     direct.d_reclen sys/types.h sys/dir.h
18 mem     dirent.d_fileno,dirent.d_ino,dirent.d_namlen,dirent.d_off,dirent.d_reclen sys/types.h dirent.h
19 mem     DIR.dd_fd sys/types.h - dirent.h - sys/dir.h
20 sys     dir,filio,jioctl,mman,ptem,resource,socket,stream,universe
21 sys     vfork,wait
22
23 tst     tst_errno link{
24         #ifdef __cplusplus
25         extern "C" {
26         #endif
27         extern int errno;
28         error() { }
29         strerror() { }
30         #ifdef __cplusplus
31         }
32         #endif
33         main() { errno = 0; error(); strerror(); }
34 }end
35
36 tst     lib_poll_fd_1 exec{
37         #include <poll.h>
38         #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
39         #if defined(__cplusplus)
40         extern "C" {
41         #endif
42         extern int      pipe(int*);
43         #if defined(__cplusplus)
44         }
45         #endif
46         #endif
47         main()
48         {       int             rw[2];
49                 struct pollfd   fd;
50                 if (pipe(rw) < 0) return 1;
51                 fd.fd = rw[0];
52                 fd.events = POLLIN;
53                 fd.revents = 0;
54                 return poll(&fd, 1, 0) < 0;
55         }
56 }end
57
58 tst     lib_poll_fd_2 exec{
59         #include <poll.h>
60         #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
61         #if defined(__cplusplus)
62         extern "C" {
63         #endif
64         extern int      pipe(int*);
65         #if defined(__cplusplus)
66         }
67         #endif
68         #endif
69         main()
70         {       int             rw[2];
71                 struct pollfd   fd;
72                 if (pipe(rw) < 0) return 1;
73                 fd.fd = rw[0];
74                 fd.events = POLLIN;
75                 fd.revents = 0;
76                 return poll(1, &fd, 0) < 0;
77         }
78 }end
79
80 cat{
81         #if _lib_poll_fd_1 || _lib_poll_fd_2
82         #define _lib_poll       1
83         #endif
84         #if _lib_NutForkExecve
85         #define _map_spawnve    NutForkExecve
86         #else
87         #if _lib_pcreateve
88         #define _map_spawnve    pcreateve
89         #endif
90         #endif
91 }end
92
93 tst     lib_select link{
94         #include <sys/types.h>
95         #include <sys/time.h>
96         #include <sys/socket.h>
97         main()
98         {       struct timeval  tmb;
99                 fd_set          rd;
100                 FD_ZERO(&rd);
101                 FD_SET(0,&rd);
102                 tmb.tv_sec = 0;
103                 tmb.tv_usec = 0;
104                 select(1,&rd,(fd_set*)0,(fd_set*)0,&tmb);
105                 return 0;
106         }
107 }end
108
109 tst     pipe_rw exec{
110         #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
111         #if defined(__cplusplus)
112         extern "C" {
113         #endif
114         extern int      pipe(int*);
115         extern int      read(int, void*, int);
116         extern int      strcmp(const char*, const char*);
117         extern int      write(int, void*, int);
118         #if defined(__cplusplus)
119         }
120         #endif
121         #endif
122         main()
123         {
124                 static char     test[] = "test\n";
125                 int             io[2];
126                 char            buf[sizeof(test)];
127                 if (pipe(io)) return(1);
128                 if (write(io[1], test, sizeof(test)) != sizeof(test)) return(1);
129                 if (read(io[0], buf, sizeof(test)) != sizeof(test)) return(1);
130                 if (strcmp(test, buf)) return(1);
131                 if (write(io[0], test, sizeof(test)) != sizeof(test)) return(1);
132                 if (read(io[1], buf, sizeof(test)) != sizeof(test)) return(1);
133                 if (strcmp(test, buf)) return(1);
134                 return(0);
135         }
136 }end
137
138 tst     real_vfork exec{
139         int             code;
140         extern int      vfork();
141         main()
142         {
143                 code = 1;
144                 if (!vfork()) code = 0;
145                 return code;
146         }
147 }end
148
149 tst     stream_peek link{
150         #include <sys/types.h>
151         #include <stropts.h>
152         main()
153         {       struct strpeek  pbuf;
154                 pbuf.flags = 0;
155                 pbuf.ctlbuf.maxlen = pbuf.databuf.maxlen =
156                 pbuf.ctlbuf.len = pbuf.databuf.len = 0;
157                 pbuf.ctlbuf.buf = pbuf.databuf.buf = 0;
158                 ioctl(0,I_PEEK,&pbuf);
159                 return 0;
160         }
161 }end
162
163 tst     socket_peek link{
164         #include <sys/types.h>
165         #include <sys/socket.h>
166         main()
167         {       char    buf[128];
168                 recv(0,buf,sizeof(buf),MSG_PEEK);
169                 return 0;
170         }
171 }end
172
173 tst     lib_mmap sys/types.h fcntl.h mman.h sys/mman.h exec{
174         main(argc, argv)
175         int     argc;
176         char**  argv;
177         {
178                 int     fd;
179                 caddr_t p;
180                 return((fd = open(argv[0], 0)) < 0 || !(p = (caddr_t)mmap((caddr_t)0, 1024, PROT_READ, MAP_SHARED, fd, 0L)) || p == ((caddr_t)-1));
181         }
182 }end
183
184 tst     ptr_dd_buf sys/types.h - dirent.h - ndir.h - sys/dir.h comp{
185         main()
186         {
187                 DIR*    dirp;
188                 dirp->dd_buf = 0;
189         }
190 }end
191
192 tst     run{
193         u=att
194         case `/bin/cat -s /dev/null/foo 2>&1` in
195         '')     ;;
196         *)      case `/bin/echo '\\\\t'` in
197                 '\\t')  u=ucb ;;
198                 esac
199                 ;;
200         esac
201         echo "#define _UNIV_DEFAULT     \\"$u\\""
202 }end
203
204 std     malloc exec{
205         #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
206         #if __cplusplus
207         extern "C" {
208         #endif
209         extern char* strdup(const char*);
210         char* malloc(unsigned n) { return 0; }
211         #if __cplusplus
212         }
213         #endif
214         #else
215         extern char* strdup();
216         char* malloc(n) unsigned n; { return 0; }
217         #endif
218         main() { return strdup("yo") == 0; }
219 }end
220
221 std     signal nolink{
222         #if __cplusplus
223         extern "C" {
224         #endif
225         extern int abort();
226         int signal() { return 0; }
227         #if __cplusplus
228         }
229         #endif
230         main() { signal(); abort(); return 0; }
231 }end