--- a/UnixOperatingSystem.st Thu Nov 12 14:54:14 1998 +0100
+++ b/UnixOperatingSystem.st Thu Nov 12 18:35:20 1998 +0100
@@ -95,97 +95,6 @@
# define WANT_SYSTEM
#endif
-#ifdef __VMS__
-# undef __new
-# undef HAS_WAITPID
-# undef HAS_WAIT3
-# undef WANT_REALPATH
-# undef HAS_USLEEP
-# define NO_WAITPID
-# define NO_SETITIMER
-# define NO_GRP_H
-# define HAS_REMOVE
-
-# ifdef __openVMS__
-# ifndef _UNISTD_H_INCLUDED_
-# include <unistd.h>
-# define _UNISTD_H_INCLUDED_
-# endif
-# endif
-
- /*
- * req'd for additional fileInfo
- */
-# include <rms.h> /* */
-# include <fabdef.h>
-
- /*
- * req'd for subprocess support
- */
-# include <iodef.h>
-# include <ssdef.h>
-# include <syidef.h>
-# include <clidef.h>
-# include <stsdef.h>
-# include <dvidef.h>
-# include <nam.h>
-# include <descrip.h>
-# include <lib$routines.h>
-# include <starlet.h>
-
-# define xxxUSE_SLOW_ALARM
-# define USE_AST_TIMER
-
-/* VMS variable length string */
-struct Vstring {
- short length;
- char body[NAM$C_MAXRSS+1];
-};
-
-/* VMS typeahead-ask struct */
-
-struct typahdask {
- short typcnt; /* chars in buffer */
- char firstChar; /* first character */
- char reserve1; /* secret */
- long reserve2; /* secret */
-};
-
-/* VMS I/O status block */
-struct IOSB {
- short status, count;
- long devinfo;
-};
-
-/* VMS Item List 3 structure */
-struct itm$list3 {
- short buflen;
- short itemcode;
- void *buffer;
- size_t *retlen;
-};
-
-/* ST/X maintained per-process information */
-
-struct procInfo {
- long returnStatus;
- long pid;
- char eventFlag;
- char finished;
- struct procInfo *nextProc;
-};
-
-/*
- * move this to alphaIntern.h ...
- */
-# if __VMS_VER < 70000000
-# define NO_PWD
-# endif
-# define NO_PWD_PASSWD
-# define NO_PWD_GECOS
-
-#endif /* __VMS__ */
-
/*
* notice: although many systems' include files
* already block against multiple inclusion, some
@@ -681,18 +590,6 @@
%}
! !
-!UnixOperatingSystem primitiveVariables!
-%{
-
-#ifdef __VMS__
-static struct procInfo *procInfoHead = (struct procInfo *)0;
-static struct procInfo *procInfoFree = (struct procInfo *)0;
-static unsigned char procEventFlag = 1;
-#endif
-
-%}
-! !
-
!UnixOperatingSystem primitiveFunctions!
%{
@@ -1027,200 +924,6 @@
# define HAS_REALPATH
#endif /* WANT_REALPATH && not HAS_REALPATH */
-#ifdef __VMS__
-
-/* #define TRACE_STAT_CALLS /* */
-/* #define TRACE_ACCESS_CALLS /* */
-
-/*
- * a stat which retries with appended '.DIR' in case of
- * failure.
- * This allows to stat a directory.
- */
-int
-__vms_stat__(path, buffP)
- char *path;
- struct stat *buffP;
-{
- int ret;
- int retry = 0;
- char t[MAXPATHLEN+1+5+2];
-
-# ifdef TRACE_STAT_CALLS
- printf("===> stat('%s')\n", path);
-# endif
- do {
- ret = stat(path, buffP);
- } while ((ret < 0) && (errno == EINTR));
-
- if (ret < 0) {
- /*
- * try with appended ';0';
- * but only, if it has no version
- */
- if (strchr(path, ';') == NULL) {
- strncpy(t, path, MAXPATHLEN);
- t[MAXPATHLEN] = '\0';
- strcat(t, ";0");
-# ifdef TRACE_STAT_CALLS
- printf("===> stat('%s') - retry\n", t);
-# endif
- do {
- ret = stat(t, buffP);
- } while ((ret < 0) && (errno == EINTR));
- if (ret >= 0)
- return ret;
- }
-
- /*
- * try with appended '.DIR';
- * but only, if it has no extension.
- */
- if (strchr(path, '.') == NULL) {
- strncpy(t, path, MAXPATHLEN);
- t[MAXPATHLEN] = '\0';
- strcat(t, ".DIR;0");
- retry = 1;
- } else {
- /*
- * try with appended 'DIR';
- * but only, if it ends with '.'.
- */
- if (path[strlen(path)-1] == '.') {
- strncpy(t, path, MAXPATHLEN);
- t[MAXPATHLEN] = '\0';
- strcat(t, "DIR;0");
- retry = 1;
- }
- }
-
- if (retry) {
-# ifdef TRACE_STAT_CALLS
- printf("===> stat('%s') - retry\n", t);
-# endif
- do {
- ret = stat(t, buffP);
- } while ((ret < 0) && (errno == EINTR));
- }
- }
- return ret;
-}
-# define stat(__path__, __buffP__) __vms_stat__(__path__, __buffP__)
-
-/*
- * same for access
- */
-int
-__vms_access__(path, mode)
- char *path;
- int mode;
-{
- int ret;
- int retry = 0;
- char t[MAXPATHLEN+1+5];
-
- do {
- ret = access(path, mode);
- } while ((ret < 0) && (errno == EINTR));
- if (ret < 0) {
- /*
- * try with appended '.DIR';
- * but only, if it has no extension.
- */
- if (strchr(path, '.') == NULL) {
- strncpy(t, path, MAXPATHLEN);
- t[MAXPATHLEN] = '\0';
- strcat(t, ".DIR");
- retry = 1;
- } else {
- if (path[strlen(path)-1] == '.') {
- strncpy(t, path, MAXPATHLEN);
- t[MAXPATHLEN] = '\0';
- strcat(t, "DIR");
- retry = 1;
- }
- }
- if (retry) {
- do {
- ret = access(t, mode);
- } while ((ret < 0) && (errno == EINTR));
- }
- }
- return ret;
-}
-# define access(__path__, __mode__) __vms_access__(__path__, __mode__)
-
-/* #define WAITDEBUG /* */
-/* #define PROCESSDEBUG /* */
-
-void
-__vms_ASTChildWithInfo(pInfo)
- struct procInfo *pInfo;
-{
-#ifdef WAITDEBUG
- printf("__vms_ASTChildWithInfo pI=%x\n", pInfo);
-#endif
-
- pInfo->finished = 1;
- __vmsASTChild(); /* this signals an ST/X interrupt */
-}
-
-int
-__vms_waitPid(pidToWait, pStatus, pPid)
- int pidToWait;
- long *pStatus, *pPid;
-{
- extern struct procInfo *procInfoHead, *procInfoFree;
- struct procInfo *pInfo, *prevInfo;
-
- prevInfo = 0;
-#ifdef WAITDEBUG
- printf("__vms_waitPid ...\r\n", pInfo);
-#endif
-
- for (pInfo = procInfoHead; pInfo; pInfo = pInfo->nextProc) {
-#ifdef WAITDEBUG
- printf("__vms_waitPid pI=%x\r\n", pInfo);
-#endif
- if (pInfo->finished) {
-#ifdef WAITDEBUG
- printf(" finished\n");
-#endif
- if ((pidToWait == -1)
- || (pInfo->pid == pidToWait)) {
-#ifdef WAITDEBUG
- printf(" pid is %d\n", pInfo->pid);
-#endif
- if ((pInfo->returnStatus & STS$M_SUCCESS) != STS$M_SUCCESS)
- *pStatus = pInfo->returnStatus;
- else
- *pStatus = 0;
-#ifdef WAITDEBUG
- printf(" status is %d (returning %d)\n", pInfo->returnStatus, *pStatus);
-#endif
- *pPid = pInfo->pid;
-
- /*
- * link this infoBlock back to the freeList
- */
- if (prevInfo) {
- prevInfo->nextProc = pInfo->nextProc;
- } else {
- procInfoHead = pInfo->nextProc;
- }
- pInfo->nextProc = procInfoFree;
- procInfoFree = pInfo;
- return 1;
- }
- }
- }
-#ifdef WAITDEBUG
- printf("no child\r\n");
-#endif
- return 0;
-}
-
-#endif /* __VMS__ */
%}
! !
@@ -4606,7 +4309,7 @@
|info type mode uid gid size id atime mtime ctime path|
%{ /* STACK: 1200 */
-#if defined(S_IFLNK) && !defined(__openVMS__) && !defined(MSDOS_LIKE)
+#if defined(S_IFLNK)
struct stat buf;
int ret;
char pathBuffer[1024];
@@ -4802,9 +4505,7 @@
if (__isString(pathName)) {
#ifdef HAS_GETCWD
-# if defined(UNIX_LIKE) ||defined(__VMS__) || defined(MSDOS_LIKE)
- if (strcmp(__stringVal(pathName), ".") == 0)
- {
+ if (strcmp(__stringVal(pathName), ".") == 0) {
char nameBuffer[MAXPATHLEN + 1];
if (@global(CurrentDirectory) == nil) {
@@ -4817,7 +4518,6 @@
}
RETURN (@global(CurrentDirectory));
}
-# endif /* UNIX_LIKE */
#endif /* HAS_GETCWD */
#ifdef HAS_REALPATH
@@ -5145,14 +4845,6 @@
After enabling, these signals will send the message
'childSignalInterrupt' to the ChildSignalInterruptHandler object."
-%{
-#ifdef __VMS__
- extern void __vmsEnableChildInterrupts();
-
- __vmsEnableChildInterrupts();
- RETURN(self);
-#endif
-%}.
self enableSignal:(self sigCHLD)
!
@@ -7043,7 +6735,7 @@
through interrupts (i.e. SIGCHILD)"
%{ /* NOCONTEXT */
-#if defined(SIGCHLD) || defined(SIGCLD) || defined(__VMS__)
+#if defined(SIGCHLD) || defined(SIGCLD)
RETURN (true);
#endif
%}.
@@ -8177,21 +7869,20 @@
|pid status code core|
%{
-#if defined(UNIX_LIKE) && !defined(__VMS__)
int p;
-# if defined(HAS_WAITPID)
+#if defined(HAS_WAITPID)
int s;
# define __WAIT waitpid(-1, &s, blocking == true ? WUNTRACED : WNOHANG|WUNTRACED)
-# else
-# if defined(HAS_WAIT3)
+#else
+# if defined(HAS_WAIT3)
union wait s;
# define __WAIT wait3(&s, blocking == true ? WUNTRACED : WNOHANG|WUNTRACED, 0)
-# else /* neither waitpid, nor wait3; use wait, which is blocking */
+# else /* neither waitpid, nor wait3; use wait, which is blocking */
int s;
# define __WAIT wait(&s)
@@ -8204,44 +7895,44 @@
*/
goto done;
}
-# endif /*!HAS_WAIT3*/
-# endif /*!HAS_WAITPID*/
-
-# if !defined(WIFEXITED)
-# define WIFEXITED(stat) (((int)((stat)&0377))==0)
-# define WIFSIGNALED(stat) (((int)((stat)&0377))>0&&((int)(((stat)>>8)&0377))==0)
-# define WIFSTOPPED(stat) (((int)((stat)&0377))==0177&&((int)(((stat)>>8)&0377))!=0)
-
-# define WEXITSTATUS(stat) ((int)(((stat)>>8)&0377))
-# define WTERMSIG(stat) (((int)((stat)&0377))&0177)
-# define WSTOPSIG(stat) ((int)(((stat)>>8)&0377))
-# endif /*!WIFEXITED*/
-
-# if !defined(WCOREDUMP)
+# endif /*!HAS_WAIT3*/
+#endif /*!HAS_WAITPID*/
+
+#if !defined(WIFEXITED)
+# define WIFEXITED(stat) (((int)((stat)&0377))==0)
+# define WIFSIGNALED(stat) (((int)((stat)&0377))>0&&((int)(((stat)>>8)&0377))==0)
+# define WIFSTOPPED(stat) (((int)((stat)&0377))==0177&&((int)(((stat)>>8)&0377))!=0)
+
+# define WEXITSTATUS(stat) ((int)(((stat)>>8)&0377))
+# define WTERMSIG(stat) (((int)((stat)&0377))&0177)
+# define WSTOPSIG(stat) ((int)(((stat)>>8)&0377))
+#endif /*!WIFEXITED*/
+
+#if !defined(WCOREDUMP)
/*
* some systems lack that definition, although the field is there ...
*/
-# if defined(HAS_WAIT3)
-# define WCOREDUMP(status) (((union __wait*)&(status))->__w_coredump)
-# else
-# define WCOREDUMP(status) ((int)(((status)>>8)&0200))
-# endif
-# endif /*!WCOREDUMP*/
-
-# if __BLOCKING_WAIT__
+# if defined(HAS_WAIT3)
+# define WCOREDUMP(status) (((union __wait*)&(status))->__w_coredump)
+# else
+# define WCOREDUMP(status) ((int)(((status)>>8)&0200))
+# endif
+#endif /*!WCOREDUMP*/
+
+#if __BLOCKING_WAIT__
__BEGIN_INTERRUPTABLE__
-# endif
+#endif
do {
p = __WAIT;
} while (p == -1 && errno == EINTR);
-# if __BLOCKING_WAIT__
+#if __BLOCKING_WAIT__
__END_INTERRUPTABLE__
-# undef __BLOCKING_WAIT__
-# endif
-
-# undef __WAIT
+# undef __BLOCKING_WAIT__
+#endif
+
+#undef __WAIT
if (p == 0)
RETURN(nil)
@@ -8262,14 +7953,13 @@
status = @symbol(stop);
code = __MKSMALLINT(WSTOPSIG(s));
}
-# if defined(WIFCONTINUED)
+#if defined(WIFCONTINUED)
else if (WIFCONTINUED(s)) {
status = @symbol(continue);
}
-# endif
+#endif
}
done: ;
-#endif /* UNIX_LIKE */
%}.
(status isNil or:[pid isNil]) ifTrue:[
@@ -8334,39 +8024,6 @@
}
# endif /* FIONREAD */
#endif
-
-# ifdef __VMS__
-# ifdef DOES_NOT_WORK_YET
- {
- /*
- * do a sys$qio ..
- * fd here is suposed to be a channel nr.
- */
- struct IOSB iosb;
- int status;
- int channel;
- struct typahdask sensebuf;
-
- if (__isSmallInteger(fd)) {
- channel = __intVal(fd);
- status = SYS$QIO(0, /* efn */
- channel,
- IO$_SENSEMODE | IO$M_TYPEAHDCNT,
- &iosb,
- 0, /* ast */
- 0, /* ast arg */
- &sensebuf, /* data */
- sizeof(sensebuf), /* data size */
- 0, 0, 0, 0);
- if (status != SS$_NORMAL) {
- fprintf(stderr, "OS [info]: SYS$QIO failed on %d\n", channel);
- } else {
- fprintf(stderr, "sys$QIO -> %d\n", sensebuf.typcnt);
- }
- }
- }
-# endif
-# endif /* __VMS__ */
%}.
^ super readCheck:fd
@@ -8850,6 +8507,6 @@
!UnixOperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.42 1998-11-12 13:53:34 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.43 1998-11-12 17:35:20 cg Exp $'
! !
UnixOperatingSystem initialize!