Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #411838
| Subject | Re: WHOA! Microsoft strikes again... |
|---|---|
| References | (11 earlier) <ngv34m$moc$1@gonzo.alcatraz> <7qKdncDNyYHRzK7KnZ2dnUU7-XvNnZ2d@supernews.com> <nh4fvm$i35$1@gonzo.alcatraz> <mvednYDltdGVcajKnZ2dnUU7-UnNnZ2d@supernews.com> <nh5f13$na1$1@gonzo.alcatraz> |
| Newsgroups | sci.electronics.design |
| From | Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> |
| Message-ID | <57365301.1040805@electrooptical.net> (permalink) |
| Date | 2016-05-13 18:19 -0400 |
On 05/13/2016 04:56 PM, Jasen Betts wrote: > On 2016-05-13, Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote: >>> >>> makes no difference. >>> >>>> I use the normal argc/argv mechanism in programs that run on both Linux (gcc) >>>> and Windows (Visual Studio), and have never had to change that part of the >>>> code for Windows. >>> >>> You get half-arsed argv[] supprt on windows, it's good enough >>> for more than 90% of use cases. >> >> That's completely different from your first story, where you claimed >> that there was only a single string. That is clearly false. > > Here microsoft explains how argv is formed from a single string > https://msdn.microsoft.com/en-us/library/17w5ykft.aspx > resumably that is the the single string that createprocess receives as > commandline. So? Where does it say that there's only one string? The sample code loops for (count = 0; count < argc; count++) which looks pretty vanilla C to me. The rest of the article is mostly about reserved characters, which are indeed different between OSes, but that's far from a "single string". > >>> Try writing a work-alile for or printf(1), watch, tr, grep or sed where >>> you can expect the user to want to use arbitrary symbols (and control >>> characters) in the arguments. >> >> You can print anything with printf, using the "%c" format specifier. >> The others are application programs, not part of the OS. > > they are _all_, application programs, printf(1) means /usr/bin/printf We're talking about C programming, or we were until you started trying to move the goal posts. Good luck referencing argv[] from printf(1). > > it seems to be more a limitation of the shell, than windows itself, Sure. I'm not trying to bust your stones, just to get to the root of the matter. > > >>>>> I did somge googleing, it seems they're using a linux emulation layer >>>>> (like wine but pointing the opposite direction) so they can fake argv[] >>>>> in a self-consistent way without too much effort, fork will be trickier. >>>> >>>> Cygwin has had fork() for years. >>> >>> they do a merry dance to get an almost fully working fork. >> >> What exactly is wrong with it? And what sort of "merry dance" that's >> more than is necessary in *nix? > > in *nix fork is a kernel call. it increments the access count, and sets the > copy-on-write bit on all the memory pages, duplicates some file handles and > creates a new process as a clone of the existing one. > > On windows you can't start a process that has a copy of anothers current > environment cheaply. AIUI you either start a thread that's sharing the > same environment or you start a new process in a new environment. > > AIUI cygwin does explicit copying to duplicate everything first. But MS has control of the Windows kernel code, so they can implement copy-on-write semantics without too much difficulty, I'd have thought. No? Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net
Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: WHOA! Microsoft strikes again... Jasen Betts <jasen@xnet.co.nz> - 2016-05-11 10:56 +0000
Re: WHOA! Microsoft strikes again... Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2016-05-11 11:35 -0400
Re: WHOA! Microsoft strikes again... Jasen Betts <jasen@xnet.co.nz> - 2016-05-13 12:06 +0000
Re: WHOA! Microsoft strikes again... Jasen Betts <jasen@xnet.co.nz> - 2016-05-13 12:40 +0000
Re: WHOA! Microsoft strikes again... Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2016-05-13 11:00 -0400
Re: WHOA! Microsoft strikes again... Jasen Betts <jasen@xnet.co.nz> - 2016-05-13 20:56 +0000
Re: WHOA! Microsoft strikes again... Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2016-05-13 18:19 -0400
Re: WHOA! Microsoft strikes again... Jasen Betts <jasen@xnet.co.nz> - 2016-05-14 06:21 +0000
Re: WHOA! Microsoft strikes again... Lasse Langwadt Christensen <langwadt@fonz.dk> - 2016-05-11 09:54 -0700
Re: WHOA! Microsoft strikes again... M Philbrook <jamie_ka1lpa@charter.net> - 2016-05-11 14:05 -0400
Re: WHOA! Microsoft strikes again... Jasen Betts <jasen@xnet.co.nz> - 2016-05-13 12:38 +0000
Re: WHOA! Microsoft strikes again... Jasen Betts <jasen@xnet.co.nz> - 2016-05-13 12:35 +0000
csiph-web