Convert uses of XKeycodeToKeysym (deprecated) to XkbKeycodeToKeysym
[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         extern int      _exit(int);
142         main()
143         {
144                 code = 1;
145                 if (!vfork()) code = 0;
146                 _exit(code);
147         }
148 }end
149
150 tst     stream_peek link{
151         #include <sys/types.h>
152         #include <stropts.h>
153         main()
154         {       struct strpeek  pbuf;
155                 pbuf.flags = 0;
156                 pbuf.ctlbuf.maxlen = pbuf.databuf.maxlen =
157                 pbuf.ctlbuf.len = pbuf.databuf.len = 0;
158                 pbuf.ctlbuf.buf = pbuf.databuf.buf = 0;
159                 ioctl(0,I_PEEK,&pbuf);
160                 return 0;
161         }
162 }end
163
164 tst     socket_peek link{
165         #include <sys/types.h>
166         #include <sys/socket.h>
167         main()
168         {       char    buf[128];
169                 recv(0,buf,sizeof(buf),MSG_PEEK);
170                 return 0;
171         }
172 }end
173
174 tst     lib_mmap sys/types.h fcntl.h mman.h sys/mman.h exec{
175         main(argc, argv)
176         int     argc;
177         char**  argv;
178         {
179                 int     fd;
180                 caddr_t p;
181                 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));
182         }
183 }end
184
185 tst     ptr_dd_buf sys/types.h - dirent.h - ndir.h - sys/dir.h comp{
186         main()
187         {
188                 DIR*    dirp;
189                 dirp->dd_buf = 0;
190         }
191 }end
192
193 tst     run{
194         u=att
195         case `/bin/cat -s /dev/null/foo 2>&1` in
196         '')     ;;
197         *)      case `/bin/echo '\\\\t'` in
198                 '\\t')  u=ucb ;;
199                 esac
200                 ;;
201         esac
202         echo "#define _UNIV_DEFAULT     \\"$u\\""
203 }end
204
205 std     malloc exec{
206         #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
207         #if __cplusplus
208         extern "C" {
209         #endif
210         extern char* strdup(const char*);
211         char* malloc(unsigned n) { return 0; }
212         #if __cplusplus
213         }
214         #endif
215         #else
216         extern char* strdup();
217         char* malloc(n) unsigned n; { return 0; }
218         #endif
219         main() { return strdup("yo") == 0; }
220 }end
221
222 std     signal nolink{
223         #if __cplusplus
224         extern "C" {
225         #endif
226         extern int abort();
227         int signal() { return 0; }
228         #if __cplusplus
229         }
230         #endif
231         main() { signal(); abort(); return 0; }
232 }end