fix IO for simplesim
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@320 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
fe63bae633
commit
d108f4123c
@ -373,6 +373,14 @@ unix_upd_stream_info (StreamDesc * s)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#if HAVE_ISATTY
|
#if HAVE_ISATTY
|
||||||
|
#if __simplescalar__
|
||||||
|
/* isatty does not seem to work with simplescar. I'll assume the first
|
||||||
|
three streams will probably be ttys (pipes are not thatg different) */
|
||||||
|
if (s-Stream < 3) {
|
||||||
|
s->u.file.name = LookupAtom("tty");
|
||||||
|
s->status |= Tty_Stream_f|Reset_Eof_Stream_f|Promptable_Stream_f;
|
||||||
|
}
|
||||||
|
#else
|
||||||
{
|
{
|
||||||
int filedes; /* visualc */
|
int filedes; /* visualc */
|
||||||
filedes = YP_fileno (s->u.file.file);
|
filedes = YP_fileno (s->u.file.file);
|
||||||
@ -386,6 +394,7 @@ unix_upd_stream_info (StreamDesc * s)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif /* HAVE_ISATTY */
|
#endif /* HAVE_ISATTY */
|
||||||
#endif /* _MSC_VER */
|
#endif /* _MSC_VER */
|
||||||
s->status |= Seekable_Stream_f;
|
s->status |= Seekable_Stream_f;
|
||||||
|
17
C/sysbits.c
17
C/sysbits.c
@ -107,6 +107,10 @@ STATIC_PROTO (int chdir, (char *));
|
|||||||
/* #define signal skel_signal */
|
/* #define signal skel_signal */
|
||||||
#endif /* MACYAP */
|
#endif /* MACYAP */
|
||||||
|
|
||||||
|
#if __simplescalar__
|
||||||
|
char yap_pwd[YAP_FILENAME_MAX];
|
||||||
|
#endif
|
||||||
|
|
||||||
STD_PROTO (void exit, (int));
|
STD_PROTO (void exit, (int));
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -1505,7 +1509,6 @@ int TrueFileName (char *source, char *result, int in_lib)
|
|||||||
|
|
||||||
#if __simplescalar__
|
#if __simplescalar__
|
||||||
/* does not implement getcwd */
|
/* does not implement getcwd */
|
||||||
char *yap_pwd = getenv("PWD");
|
|
||||||
strncpy(ares1,yap_pwd,YAP_FILENAME_MAX);
|
strncpy(ares1,yap_pwd,YAP_FILENAME_MAX);
|
||||||
#elif HAVE_GETCWD
|
#elif HAVE_GETCWD
|
||||||
if (getcwd (ares1, YAP_FILENAME_MAX) == NULL)
|
if (getcwd (ares1, YAP_FILENAME_MAX) == NULL)
|
||||||
@ -1595,7 +1598,6 @@ p_getcwd(void)
|
|||||||
|
|
||||||
#if __simplescalar__
|
#if __simplescalar__
|
||||||
/* does not implement getcwd */
|
/* does not implement getcwd */
|
||||||
char *yap_pwd = getenv("PWD");
|
|
||||||
strncpy(FileNameBuf,yap_pwd,YAP_FILENAME_MAX);
|
strncpy(FileNameBuf,yap_pwd,YAP_FILENAME_MAX);
|
||||||
#elif HAVE_GETCWD
|
#elif HAVE_GETCWD
|
||||||
if (getcwd (FileNameBuf, YAP_FILENAME_MAX) == NULL)
|
if (getcwd (FileNameBuf, YAP_FILENAME_MAX) == NULL)
|
||||||
@ -1787,10 +1789,7 @@ p_cd (void)
|
|||||||
}
|
}
|
||||||
TrueFileName (FileNameBuf, FileNameBuf2, FALSE);
|
TrueFileName (FileNameBuf, FileNameBuf2, FALSE);
|
||||||
#if __simplescalar__
|
#if __simplescalar__
|
||||||
strncpy(FileNameBuf,"PWD=",YAP_FILENAME_MAX);
|
strncpy(yap_pwd,FileNameBuf2,YAP_FILENAME_MAX);
|
||||||
strncat(FileNameBuf,FileNameBuf2,YAP_FILENAME_MAX);
|
|
||||||
fprintf(stderr,"adding %s\n", FileNameBuf);
|
|
||||||
putenv(FileNameBuf);
|
|
||||||
#endif
|
#endif
|
||||||
return (!chdir (FileNameBuf2));
|
return (!chdir (FileNameBuf2));
|
||||||
#else
|
#else
|
||||||
@ -2057,6 +2056,12 @@ set_fpu_exceptions(int flag)
|
|||||||
void
|
void
|
||||||
InitSysbits (void)
|
InitSysbits (void)
|
||||||
{
|
{
|
||||||
|
#if __simplescalar__
|
||||||
|
{
|
||||||
|
char *pwd = getenv("PWD");
|
||||||
|
strncpy(yap_pwd,pwd,YAP_FILENAME_MAX);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
InitPageSize();
|
InitPageSize();
|
||||||
InitTime ();
|
InitTime ();
|
||||||
InitWTime ();
|
InitWTime ();
|
||||||
|
Reference in New Issue
Block a user