posix.c
Go to the documentation of this file.
00001 /****************************************************************/
00002 /* posix.c
00003 /*      1995-Jul        nanosleep by S.Kagami.
00004 /****************************************************************/
00005 
00006 
00007 #include "eus.h"
00008 
00009 #if Solaris2
00010 typedef struct {
00011     long        tv_sec; /* seconds */
00012     long        tv_nsec;/* and nanoseconds */
00013 } timespec;
00014 
00015 pointer NANOSLEEP(context *ctx, int n, pointer *argv)
00016 {
00017     timespec rqtp, rmtp;
00018 
00019     ckarg(2);
00020     rqtp.tv_sec = ckintval(argv[0]);
00021     rqtp.tv_nsec = ckintval(argv[1]);
00022 
00023     nanosleep(&rqtp, &rmtp);
00024     return(T);
00025 }
00026 #endif
00027 
00028 /* initialization of posix functions*/
00029 posix(context *ctx, int n, pointer argv[])
00030 {
00031   pointer mod=argv[0];
00032 
00033     pointer p=spevalof(PACKAGE);
00034 
00035     spevalof(PACKAGE)=unixpkg;
00036 
00037 #if Solaris2
00038     defun(ctx,"NANOSLEEP",mod,NANOSLEEP);
00039 #endif
00040 
00041 /* restore package*/  spevalof(PACKAGE)=p;
00042 }


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Mar 9 2017 04:57:50