From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,379448a54fafa5c9 X-Google-Attributes: gidf7344,public X-Google-Thread: 1051a8,dd67877c854c94c4 X-Google-Attributes: gid1051a8,public X-Google-Thread: 110292,dd67877c854c94c4 X-Google-Attributes: gid110292,public X-Google-Thread: 1164f8,14e882a2e94c4748 X-Google-Attributes: gid1164f8,public From: "Eric D. Osborne" Subject: Re: What Does DEC Have Left? (was: Current Unpleasantness Resolved) Date: 1997/11/21 Message-ID: <34753FEF.1EB6@mail.dec.com>#1/1 X-Deja-AN: 291226609 References: <63d177$ri9@flonk.uk.sun.com> <63l9ub$unp@usenet.pa.dec.com> <63q7l7$b7f@flonk.uk.sun.com> <64a3dk$f3b@usenet.pa.dec.com> <64a8d1$j$1@joe.rice.edu> <3469E169.28C94972@zuo.dec.com> <346C4EA7.358C8E67@yes.optus.com.au> <64ia1i$of4$2@joe.rice.edu> Reply-To: osborneer@mail.dec.com Organization: Digital Equipment Corporation Newsgroups: comp.os.vms,comp.sys.dec,comp.sys.intel,comp.sys.mips Anil Thomas Maliyekkel wrote: > > > Because the interfaces necessary to take advantage of 64 bit address > spaces and 64 bit file systems involve using differ data types > for the parameters. Most UNIX applications have been written to use > 32 bit paramaters for file system operations and have been written > to take advantage of 32 address spaces. 32 bit UNIX 95 compliant > OSes share the identical interfaces which makes portibility between > these OSes much easier. Since Digital decided to eschew 32 bit > compatibility in Digital Unix, it made it harder for companies > to port applications over. Also paging characteristics for 64 bit > OSes makes performance and memory consumption optimization more > difficult for programs that were designed to run optimally on > 32 bit OSes. This kind of thing really bugs me, because it is just blatantly WRONG. Digital UNIX on ALPHA is pretty much always fully source compatible with Solaris and HP/UX, assuming PROPERLY (e.g., standards compliant code). The biggest portability problem is sloppy coding. If you write code to the proper ANSI standards, at a source level it is transparent (or nearly so) when moving between Digital UNIX and Sun/HP/whatever systems. I've done a LOT of this, and in general, once I've ported the code it will compile without a hitch on other vendor systems. Case in point - the POSIX.1 and XPG standards for file I/O primitives use the defined type t_offset to describe the file position pointer in lseek, and size_t for read, write, etc. These object types - t_offset, size_t, etc., are abstractions that are defined in the system header file sys/types.h A good ANSI compiler (we have a good one :-) ) will complain if you use the wrong parameter types on the calls (and well it should). So, if you have code like this int f; /* file descriptor */ int ret_code; /* for return code checking */ char buffer[BUFSIZE]; /* put in code to open file here */ ret_code = read(f, buffer, (size_t) sizeof(buffer)); this will work on ANYTHING that is standards compliant. The problem is, people do dumb stuff like this : int f; int ret_code, size; char buffer[BUFSIZE]; /* put in code to open file here */ ret_code = read(f, buffer, size); THIS IS BROKEN, because the "size" parameter passed to the read call is of the wrong data type. This will, by blind luck, work on most 32 bit machines. It will break on DU, BUT NOT BECAUSE DU IS NON-STANDARD. It will break because it is crappy code. Fixing it will make it work on EVERYTHING, and eliminate a potential maintenence headache from the source pool forever. Even at run-time, Solaris and HP/UX will allow you to get away with really poor coding. Dereferencing of null pointers, for instance, is a BAD THING, and it happens in a lot of crufty code. Sometimes it gets by, depending on architecture. The TLI allocation calls on at least some versions of Solaris do a very poor job of checking the integrity of passed arguments. When broken (by the definition of the STANDARDS) code is moved from those machines to DU, developers are often quick to blame DU because the code doesn't work - when it is more likely bugs in the original source. I can produce examples to demonstrate this kind of thing. I would be delighted to see one where code written to standards, which does not INTENTIONALLY exploit object size differneces or byte order, doesn't port cleanly. Specifically, I would challenge anyone to show me any significant set of DU library or system calls that don't conform to the appropriate UNIX standards. About the only time you get into any trouble at all is when you make assumptions about object sizes - and that is a violation of the C language standard. At the risk of being inflamatory, I can cope with legitimate criticism as well as anyone. But I have an issue with highly opinionated, negative postings that have no basis in fact. Eric D. Osborne The opinions expressed herein are my own, and should not be construed to represent any official statement by Digital Equipment Corporation.