Article View: comp.sys.atari.st
Article #34488Minor bugs in Atari ST minix library
From: Jwahar R. Bammi
Date: Sat, 22 Oct 1988 05:31
Date: Sat, 22 Oct 1988 05:31
76 lines
2016 bytes
2016 bytes
Found two bugs in the Minix Atari ST distribution from PH:
- popen.c uses _exit(). _exit() is not in the library.
Quick Fix: replace the one occurance of _exit() with exit()
(i know they are not the same, but it is close enough for
goverment work, especially on the atari version where they
have eliminated _cleanup)
- fdopen.c is missing. Here is one:
/*
* They missed this in the standard ST distribution
* adapted from fopen.c
* ++jrb bammi@dsrgsun.ces.cwru.edu
*
*/
#include <stdio.h>
FILE *fdopen(fd,mode)
int fd;
char *mode;
{
register int i;
FILE *fp;
extern char *malloc();
int flags = 0;
/* find a table slot */
for (i = 0; _io_table[i] != 0 ; i++)
if ( i >= NFILES )
return(NULL); /* if none avail */
/* set up flags */
switch(*mode){
case 'w':
flags |= WRITEMODE;
break;
case 'a':
flags |= WRITEMODE;
break;
case 'r':
flags |= READMODE;
break;
default:
return(NULL);
}
if (( fp = (FILE *) malloc (sizeof( FILE))) == NULL )
return(NULL);
fp->_count = 0;
fp->_fd = fd;
fp->_flags = flags;
fp->_buf = malloc( BUFSIZ );
if ( fp->_buf == NULL )
fp->_flags |= UNBUFF;
else
fp->_flags |= IOMYBUF;
fp->_ptr = fp->_buf;
_io_table[i] = fp;
return(fp);
}
/* - eof - */
--
usenet: {decvax,sun}!cwjcc!bammi jwahar r. bammi
csnet: bammi@dsrgsun.ces.CWRU.edu
arpa: bammi@dsrgsun.ces.CWRU.edu
compuServe: 71515,155
Technical Details
Message-ID:
<206@cwjcc.CWRU.Edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!bammi@dsrgsun.ces.CWRU.eduShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!bammi@dsrgsun.ces.CWRU.edu From: bammi@dsrgsun.ces.CWRU.edu (Jwahar R. Bammi) Newsgroups: comp.sys.atari.st,comp.os.minix Subject: Minor bugs in Atari ST minix library Keywords: Bug Minix Atari ST Library fdopen popen Message-ID: <206@cwjcc.CWRU.Edu> Date: 22 Oct 88 05:31:57 GMT Sender: news@cwjcc.CWRU.Edu Reply-To: bammi@dsrgsun.ces.CWRU.edu (Jwahar R. Bammi) Organization: Case Western Reserve University Lines: 76