home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <sys/file.h>
- #include <sys/time.h>
- #include <sys/types.h>
- #include <stat.h>
- #include <errno.h>
-
- static int debug = 0;
-
- flock(fd, operation)
- int fd, operation;
- {
- return(0);
- }
-
- ftruncate(fd, length)
- int fd;
- off_t length;
- {
- return(0);
- }
-
- utime(file, tvp)
- char *file;
- struct timeval tvp[2];
- {
- return(0);
- }
-
- int fchown(fd, owner, group)
- int fd, owner, group;
- {
- return(-1);
- }
-
- int rmdir(path)
- char *path;
- {
- return(-1);
- }
-
- int truncate(path, length)
- char *path;
- unsigned long length;
- {
- return(0);
- }
-
- FILE *si_fopen(filename, mode)
- char *filename, *mode;
- {
- char *p, *unix2vms();
- FILE *f;
- p = unix2vms(filename);
- if (debug) fprintf(stderr,"fopen - %s\n",p);
- f = fopen(p, mode);
- return(f);
- }
-
- FILE *si_freopen(filename, mode, stream)
- char *filename, *mode;
- FILE *stream;
- {
- return(freopen(unix2vms(filename), mode, stream));
- }
-
- int si_open(filename, mode, x)
- char *filename;
- int mode, x;
- {
- if (strcmp(filename,"/dev/null") == 0) return(open("nl:",mode,x));
- if (debug) fprintf(stderr,"open - %s\n",unix2vms(filename));
- return(open(unix2vms(filename), mode));
- }
-
- int si_remove(filename)
- char *filename;
- {
- return(remove(unix2vms(filename)));
- }
-
-
- int si_stat(x,y)
- char *x;
- struct stat *y;
- {
- char pkbuff[128], *si_getenv(), *pk;
- int i;
- /*why do we do this!
- chdir(si_getenv("PATH"));
- */
- bzero(y,sizeof (struct stat));
- pk = si_getenv("PATH");
- if (debug) fprintf(stderr,"stat - current path is %s\n",pk);
- if (debug) fprintf(stderr,"stat - file=%s unixfile=%s\n",x,unix2vms(x));
- if (strcmp(x,"/dev/null") == 0) return(stat("nl:",y));
- if (strcmp(x,".") == 0 || strcmp(x,"..") == 0 || strcmp(x,"./") == 0 ||
- strcmp(x,"../") == 0) {
- y->st_mode = S_IFDIR;
- return(0);
- }
- bzero(y, sizeof(struct stat));
- strcpy(pkbuff,unix2vms(x));
- i = stat(pkbuff,y);
- if (debug) fprintf(stderr," returns %d\n",i);
- if (i == 0) return(0);
- strcat(pkbuff, ".dir");
- i = stat(pkbuff,y);
- if (debug) fprintf(stderr," returns %d\n",i);
- return(i);
- }
-
- int si_access(file, mode)
- char *file;
- int mode;
- {
- int i, temp_errno;
- char pkbuff[128];
- if (debug) fprintf(stderr,"access - %s\n",file);
- if (strcmp(file,".") == 0 || strcmp(file,"..") == 0) return(0);
- i = access(unix2vms(file), mode);
- temp_errno = errno;
- if (i == 0) return(0);
- strcpy(pkbuff, unix2vms(file));
- strcat(pkbuff, ".dir");
- i = access(pkbuff, mode);
- if (i != 0) errno = temp_errno;
- if (debug) fprintf(stderr,"returns %d\n",i);
- return(i);
- }
-
- int si_execv(path,argv)
- char *path, *argv[];
- {
- char buffer[128];
- strcpy(buffer,path);
- strcat(buffer,".exe");
- return(execv(unix2vms(buffer),argv));
- }
-
- int setlinebuf(f)
- FILE *f;
- {
- return(0);
- }
-