delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/31/07:00:11

To: davis AT amy DOT tch DOT harvard DOT edu ("John E. Davis")
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: `access still buggy
Date: Tue, 31 Jan 95 08:57:59 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

>    I have installed all 3 of the dj112m?.zip patches for djgpp.  I did
> everything in order the way the documentation says.  Still, `access' causes
> my machine to crash.  In fact, the following program reboots my machine:

access() has a bug in that it doesn't zero-out the FLAGS
field of the structure it passes to DPMI call.  You can
correct this.  Find this fragment in access.c:

int access(const char *fn, int flags)
{
  _go32_dpmi_registers r;
  r.x.ss = r.x.sp = 0;

and add this line:

  r.x.flags = 0;

Recompile access.c, put it into the libc.a library and relink
your program; it should work OK now.

Unfortunately, access() is also called extensively by GCC.EXE
which causes it to crash under certain system configurations.
But if you can compile at all, you're lucky to not be one of
the victims of this.

- Raw text -


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