ielib revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
3817N/Asys bsdtty,fcntl,file,filio,ioctl,nttyio,times,termio,termios,unistd
3817N/Ahdr fcntl,sgtty,termio,termios,unistd
3817N/A
3817N/Alib yp_get_default_domain -lnsl -lsun
3817N/A
3817N/Akey const =
3817N/A
3817N/Atyp pid_t = int
3817N/Atyp clock_t,off_t,time_t = long
3817N/A
3817N/Atst compile{
3817N/A #include <sys/file.h>
3817N/A #if defined(O_CREAT) && defined(LOCK_EX)
3817N/A int ok = 1;
3817N/A #else
3817N/A (
3817N/A #endif
3817N/A}end fail{
3817N/A echo "#undef _sys_file"
3817N/A}end
3817N/A
3817N/Atst output{
3817N/A main()
3817N/A {
3817N/A if (sizeof(int*) == 2)
3817N/A printf("#define INT16 1\n");
3817N/A return 0;
3817N/A }
3817N/A}end
3817N/A
3817N/Atst output{
3817N/A #include <setjmp.h>
3817N/A jmp_buf save;
4194N/A main()
3817N/A {
3817N/A if(_setjmp(save))
3817N/A {
3817N/A printf("#define SETJMP _setjmp\n");
3817N/A printf("#define LONGJMP _longjmp\n");
3817N/A exit(0);
3817N/A }
3817N/A done();
3817N/A }
3817N/A done()
3817N/A {
3817N/A _longjmp(save,1);
3817N/A exit(1);
3817N/A }
3817N/A}end fail{
3817N/A echo "#define SETJMP setjmp"
3817N/A echo "#define LONGJMP longjmp"
3817N/A}end
4337N/A
4337N/Atst FLOCK link{
3817N/A #include <sys/file.h>
3817N/A int main(argc,argv)
char *argv[];
{
int fd;
int r;
if(( fd = open(argv[1],0)) < 0)
return 1;
if(flock(fd,LOCK_NB|LOCK_EX)!=0)
return 2;
if(( fd = open(argv[1],0)) < 0)
return 3;
r = flock(fd,LOCK_NB|LOCK_EX);
return(r==0);
}
}end
tst - -DTERMIOS - -DTERMIOS -DPTEM - -DTERMIOS -DSTREAM - -DTERMIOS -DSTREAM -DPTEM - -DTERMIOS -DJIOCTL - -DTERMIO - -DTERMIO -DPTEM - -DTERMIO -DSTREAM - -DTERMIO -DSTREAM -DPTEM - -DTERMIO -DJIOCTL - -DSGTTY - -DSGTTY -DPTEM - -DSGTTY -DSTREAM - -DSGTTY -DSTREAM -DPTEM - -DSGTTY -DJIOCTL output{
#include <sys/types.h>
#ifdef TERMIOS
# include <termios.h>
#endif
#ifdef TERMIO
# include <termio.h>
#endif
#ifdef SGTTY
# include <sgtty.h>
#endif
#ifdef STREAM
# include <sys/stream.h>
#endif
#ifdef PTEM
# include <sys/ptem.h>
#endif
#ifdef JIOCTL
# include <sys/jioctl.h>
# define winsize jwinsize
# define ws_col bytesx
# define TIOCGWINSZ JWINSIZE
#endif
main()
{
struct winsize size;
int fd = open("/dev/tty",0);
ioctl(fd, TIOCGWINSZ, &size);
printf("#define WINSIZE 1\n");
#ifdef JIOCTL
printf("#define _sys_jioctl 1\n");
#endif /* JIOCTL */
#ifdef PTEM
printf("#define _sys_ptem 1\n");
#endif /* PTEM */
#ifdef STREAM
printf("#define _sys_stream 1\n");
#endif /* STREAM */
return 0;
}
}end
tst - -DS5 - -DS4 output{
#include <sys/types.h>
#include <sys/time.h>
main()
{
time_t t1,t2;
#ifdef S4
int milli = 2000;
#else
struct timeval timeloc;
timeloc.tv_sec = 2;
timeloc.tv_usec = 0;
#endif /* S4 */
time(&t1);
#ifdef S4
select(0,(fd_set*)0,(fd_set*)0,milli);
#else
select(0,(fd_set*)0,(fd_set*)0,(fd_set*)0,&timeloc);
#endif /* S4 */
time(&t2);
if(t2 > t1)
{
#ifdef S4
printf("#define _SELECT4_ 1\n");
#else
printf("#define _SELECT5_ 1\n");
#endif /* S4 */
return 0;
}
return 1;
}
}end
cat{
#if defined(__STDC__) || defined(__cplusplus)
#define PROTO 1
#else
#define void int
#endif
#if _lib_yp_get_default_domain
#define YELLOWP 1
#endif
#include <sys/types.h>
#if _sys_times
#include <sys/times.h>
#define included_sys_times 1
#endif
#if _sys_time
#include <sys/time.h>
#define included_sys_time 1
#endif
#define VOID void
#define SIG_NORESTART 1
#define NFILE 32
}end