Can anyone comment on IBM Xenix v2.0?

Peter da Silva peter at ficc.ferranti.com
Tue Apr 30 03:11:01 AEST 1991


In article <1991Apr26.001231.4238 at bilver.uucp> bill at bilver.uucp (Bill Vermillion) writes:
>  In the ioctl area I was taking the state of the tty and anding 
>  with something like.

>      newtty.c_(someflag) &= (somevalue).

> This worked on both the uPort and SCO but failed on IBM.  After setting two
> machine up side by side, running the code and then doing a stty
> <that_terminal   we found that the new values were being anded with the
> original values on uPort and SCO, but the new values were replacing the old
> values on the IBM version.  It did not work as documented.  Took some
> hairpulling to find that one.

I'd have to see the code, but from your description it sounds like you had
a problem with the code, or a bug in the compiler.

>   fd = creat("file",0666)

>   The file wasn't being created with those permissions.  This time we
>   found that the creat call was being anded with the permissions of the
>   user running the progam.   So to get around this one we save umask, set
>   umask to 000, ran the program, and restored umask.

But that's what it's supposed to do! I suspect your other machines were
just configured so that umask wasn't getting in your way. On creat, umask
is always complemented and anded with the mode.

> The only other thing that ever go me as bad was working on an old Z8000
> based machine with Unix III, whose compiler would NOT strip the high bits
> on incoming serial from serial device metering delivery on a propane truck.
> Believe the machine was an Onyx if memory serves.
> 
> This one would sign extend all the odd (or perhaps it was even) characters
> from a 7bit to 16 bits with the high bit set.   So every other character in
> the set was a negative number

But that's what it was supposed to do. If you're working with signed characters
(default on many machines, including the Z8000 and 80x86!) and converting
them to integers then it's suposed to sign extend.

Program the following sequence in your wetware:

	i = (((int) c) & 0xFF);

It's a lot of work to write portable (as opposed to ported) code, but it's
worth it. For one thing all sorts of "bugs" in the O/S tend to vanish.
-- 
Peter da Silva.  `-_-'  peter at ferranti.com
+1 713 274 5180.  'U`  "Have you hugged your wolf today?"



More information about the Comp.unix.xenix.misc mailing list