Xref: utzoo comp.sys.ibm.pc:28639 comp.sys.amiga:33629 Path: utzoo!utgpu!watmath!mks!alex From: alex@mks.UUCP (Alex White) Newsgroups: comp.sys.ibm.pc,comp.sys.amiga Subject: Re: OS/2 vs AmigaDOS Keywords: Operating Systems, Religion WRT computers Message-ID: <925@mks.UUCP> Date: 11 May 89 17:36:31 GMT References: <2134@iitmax.IIT.EDU> <5625@microsoft.UUCP> <917@mks.UUCP> <9616@watcgl.waterloo.edu> Reply-To: alex@mks.UUCP (Alex White) Organization: Mortice Kern Systems, Waterloo, Ontario, Canada Lines: 42 In article <9616@watcgl.waterloo.edu> bmacintyre@watcgl.waterloo.edu (Blair MacIntyre) writes: >In article <917@mks.UUCP> alex@mks.UUCP (Alex White) writes: >>In article <5625@microsoft.UUCP> w-glenns@microsoft.UUCP (Glenn Steffler) writes: >>>OS/2 is a business oriented OS, with extensive network capabilities, in >>>addition to a rich and quite overwhelming array of multitasking >>>primatives. OS/2 has memory, and resource protection, vital for multiple >>Overwhelming array of multitasking primitives? >>You've got to be kidding. >>You're right -- it has more than are ever likely to be needed, but >>it doesn't have standard simple ones like fork(). > >I hate to disappoint you, but fork() is not what most people would >consider a "standard multitasking primitive". It is a Unix'ism designed Great. Ok, how do I do it without fork? DosExecPgm has a lot of options, but it doesn't have an array of open file descriptors to pass to the child. You have to go to grotesque contortions of dup'ing and moving file descriptors around, setting close- on-exec bits in order to set the child's file descriptors up the way you want. (You CAN however do it) It doesn't have an array of signal settings to set up default signals for the child. (You CAN'T do this properly) Sure this kind of stuff isn't used very often in strict application programs, but how do you reasonably join things together with pipes? Without fork, it is NOT possible to implement say the standard unix shell because of () [subshells using the environment of the parent shell]. I've cobbled together a fork(), but its hardly the same doing it at the user level as if the kernel did it. You can't even pass args in the unix argc, argv method! Sure, DosExecPgm actually has a real argv formatted just like unix's argv -- unfortunately DosStartSession doesn't. Since cmd.exe appears to always use DosStartSession, all args are passed as argv[1], so on the off chance that you might sometime want a program called from cmd.exe, you have to have all that cruft to parse your own args... By the way, on a slightly different topic, did you know you can't delete or rename a file that is being executed out of? You can rename the directory first however, then it works... Talk about bad implementations...