www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000145

When Created: 03/26/1997 05:45:58
Against DJGPP version: 2.01
By whom: chopin@ruby.hanmesoft.co.kr
Abstract: 1. static variable, 2. system() or spawn*() call errror........
hi~~~~!!!!
how are you?
i am not good at English...
my computer is pentium 130, ram 32M, os: win95 or
win95 dos mode with cwsdpmi  djgpp : v201

my program is big.. there are many external variable.
and there are many file I/O. 

1. static variable stack_m, stack_svcnt, sv_cnt 
   is can not save value 
   when next call in function MapStackProc.
   because, i change static variable to 
   external static variable. that is ok!! 
 

int MapStackProc(int key)
{
       static char *stack_m[10];

       static char stack_svcnt[10];
       static short sv_cnt;
       .................
       .................
}


2. i suppose that i 5 file opened.. in process..
   next i call system("./cobcomp -o ./aaaaa.cob ./bbbb.cbl");
   here, cobcomp is cobol compiler..
    this errno value is 22. but, cobcomp.exe is exist..
   why???
   because, i change system() call to spawn*() call..
   signal SIGSEGV receved... and error....
   error is same cwsdpmi and win95 dpmi..
   why?? i can't know..
   please, help me...
   
   thanks to you!!
   
  :-)                :)                  ^.^              ^^    
  

Note added: 04/01/1997 00:14:45
By whom:
problum solved about system() call 
how?
 
first i get libc source code.
2. vi dosio.c
3. 20 -> 50 .. ok!!
here 20 is count of can open file..

but!!!!!!!!!!

first problum I can't solve...

first problum is local static variable failed...
 
but local static variable --> global static variable is good!!!!!!

why????????????? help me...


 

Note added: 04/01/1997 00:19:45
By whom: chopin@ruby.hanmesoft.co.kr
solved system function.
1. libc source change.. first open count...
2. set __system_call_cmdproc flag.
3. ok..

is good??

Solution added: 04/19/1997 01:23:19
By whom: fighteer@cs.com
To answer your first question, of course you can't define the same static variable
twice in a given program.  How is the linker to know which copy of the variable you
want to use?  This has nothing whatsoever to do with DJGPP; it's a requirement of
ANSI C.

Note added: 08/28/1997 20:27:01
By whom: pjfarley@dorsai.org
Hmm-m-m.  It seems to me this code needs to use Ralf Brown's interrupt list to
figure out how to get DOS to tell us how many file handles really exist.  That
would solve the problem much more permanently.

More after I consult with Ralf's files.

Fixed in version on 04/12/1999 12:00:49
By whom: eliz@is.elta.co.il



  webmaster     delorie software   privacy  
  Copyright © 2010   by DJ Delorie     Updated Jul 2010