Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

C's system() & COMMAND.COM (Developers)

posted by alexfru(R), USA, 13.09.2014, 14:21

> > > "In the UNIX system, the status return is the value returned by exit"
> > >
> > > Further it says "the return value is implementation-dependent".
> >
> > Check out some more modern stuff.
> >
> > http://pubs.opengroup.org/onlinepubs/009695399/functions/system.html:
>
> That's Unix(POSIX), not C. What are you doing, implementing a C
> compiler or an Unix-on-Dos emulation (as a cygwin for dos)?

Not really.

I want POSIX-ish behavior of system(). Some DOS compilers provide it and I am depending on it and implementing it in my C library for DOS.

I also throw in a few things like open(), lseek(), unlink() as the lowest level functions sitting between DOS system calls and fopen(), fseek() and remove(), but I may either remove them entirely or make them available only when they're actually used. I haven't decided yet. But there's no intention to provide much outside of standard C.

> The page says it is aligned with C, but the popup says that paragraph is an
> extension to C, so it would still be interesting what a newer C standard
> (C99) says about it. I may have that at work, which I can't access now.

There's nothing of interest in C99. The return value of system(non-NULL pointer) is implementation-defined according to it.

> That was the whole point of my post, to make the separation between POSIX
> and C.

I do know the difference.

 

Complete thread:

Back to the forum
Board view  Mix view
15108 Postings in 1358 Threads, 246 registered users, 13 users online (0 registered, 13 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum