AUX bugs

Charlie C. Kim cck at cunixc.columbia.edu
Thu Apr 14 00:45:34 AEST 1988


Here are a couple of A/UX problems.  Posted here because knowing about
them may help people from wasting their time like I did.  Tried and
hopefully succeeded in reporting these to Apple, so no complaints from
that quarter please.

o Kernel problems

PROBLEM: Select seems not to see an EOF (select never returns when eof
is typed).  Works just fine under all the other bsd based
systems I've tried (ultrix, bsd, hpux, pyramid, sunos).  Happens even
when setcompat to full bsd.
	#include <stdio.h>
	#include <sys/time.h>
	
	main()
	{
	  int c, rdy;
	  long i,j;
	  struct timeval t;
	
	  t.tv_sec = 0;  t.tv_usec = 250;		/* 1/4 second? */
	  c = 0;
	  do {
	    j = i = 0x1<<fileno(stdin);	/* set bitmask */
	    if ((rdy = select(fileno(stdin)+1, &i, 0, &j, &t)) < 0)
	      continue;
	    if (rdy == 0 && j==0 && i == 0 ) /* timeout and nothing selected */
	      continue;
	    c = getchar();
	    putchar(c);
	  } while (c != EOF);
	}
stdio is not the problem -- happens even when done with "bare" read
call -- makes sense because select never tells us input ready when eof
is typed.

PROBLEM: rename doesn't do the right thing when given the same file
name as source and destination.  In fact, it does the worst possible
thing -- it unlinks the file.  (Caveat: can't check to see if it
happens in all cases (I think it does) since my disk is down, but
it definitely happens when an absolute path name is given).  The
standard action is to leave the inode linked--not sure if the update
times are supposed to be modified though.

o C compiler/CPP

SUGGESTION: No defines for aux in /lib/cpp.  Makes life a pain.
Please include in next release of aux.  Be even nicer, define it to
the release level (aux 1.0 == #define aux 10 or 100).

PROBLEM: C compiler problem in relation to subroutine arguments.

In particular, sequences like:
	foo(p,l,r,rl)
	byte *p, *r;
	int *rl, l;
may result in "rl" redefined errors, etc.

It only happens when more than one such routine is defined and can be
worked around by reordering the declarations for the parameters.  The
problem file was only about 350 lines.

Charlie C. Kim
User Services
Columbia University



More information about the Comp.unix.aux mailing list