Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #411838

Re: WHOA! Microsoft strikes again...

Path csiph.com!feeder.erje.net!2.us.feeder.erje.net!news.glorb.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date Fri, 13 May 2016 17:19:46 -0500
Subject Re: WHOA! Microsoft strikes again...
References <bnuuhbhber7obhj0rkdm1s5ialjveek6s5@4ax.com> <do9e0jFf90nU2@mid.individual.net> <bc1vhbpdcpcb8455v7j64t1dgo63mtpkne@4ax.com> <ef2dncnHSKcpWILKnZ2dnUU7-W3NnZ2d@giganews.com> <op.ygj01vrowei6gd@phenom-pc> <3j60ib5a2mdabev612l204nh3oiop15mc6@4ax.com> <7793805c-5298-4d5d-ad51-b6f7c2e86e73@googlegroups.com> <fd0c1dec-47ec-4737-aa5d-a26cfb2eb45e@googlegroups.com> <VU3Uy.9474$Sk5.8536@fx45.am4> <nfvl63$70o$2@gonzo.alcatraz> <6d4f8841-e0a2-4ff0-88e0-2c51f9b38329@googlegroups.com> <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 Fri, 13 May 2016 18:19:45 -0400
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0
MIME-Version 1.0
In-Reply-To <nh5f13$na1$1@gonzo.alcatraz>
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
Lines 90
X-Trace sv3-npGQWLONWSR5Mb+CIcH3HACTNgF3D17euRXCxqyr+qJo3/GayDunGBwWYRGQyixxPzSG6TbLgTkba2G!kVIfBJ7ld2LqTNLLm3TTXKi10fwRZeal2ztqBzfzrvzCKDINXQSCtwz1pgHxwsNgisV5uA0=
X-Complaints-To www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 5037
Xref csiph.com sci.electronics.design:411838

Show key headers only | View raw


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


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