www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/12/12:49:29

Date: Sun, 12 Jul 1998 19:48:20 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: DJGPP alpha 980628 (part 2)
Message-ID: <Pine.SUN.3.91.980712194601.27114c-100000@is>
MIME-Version: 1.0

Latest versions of DOS support deeper directory trees.

*** src/libc/posix/sys/stat/mkdir.c~0	Mon Jun 29 00:13:02 1998
--- src/libc/posix/sys/stat/mkdir.c	Fri Jul 10 15:39:08 1998
***************
*** 8,13 ****
--- 8,15 ----
  #include <dpmi.h>
  #include <unistd.h>
  #include <fcntl.h>
+ #include <io.h>
+ #include <dos.h>
  #include <libc/dosio.h>
   
  int
***************
*** 15,25 ****
--- 17,38 ----
  {
    __dpmi_regs r;
    int use_lfn = _USE_LFN;
+   unsigned attr;
  
    _put_path(mydirname);
   
    if(use_lfn)
      r.x.ax = 0x7139;
+   else if ((_osmajor > 7 && _osmajor < 10) /* OS/2 returns v10 and above */
+ 	   || (_osmajor == 7 && _osminor >= 20))
+   {
+     /* DOS 7.20 (Windows 98) and later supports a new function with
+        a maximum path length of 128 characters instead of 67.  This
+        is important for deeply-nested directories.  */
+     r.x.ax = 0x43ff;
+     r.x.bp = 0x5053;
+     r.h.cl = 0x39;
+   }
    else
      r.h.ah = 0x39;
    r.x.ds = __tb_segment;
***************
*** 42,51 ****
      return -1;
    }
  
!   /* DOS ignores directory permissions, and mkdir is stub'd,
!      so rather than stub chmod also, just skip it.   DJ */
! /*  if (chmod(mydirname, mode))
!     return -1; */
    return 0;
  }
- 
--- 55,67 ----
      return -1;
    }
  
!   /* mkdir is stub'd, and we don't want to stub chmod also.  */
!   attr = _chmod(mydirname, 0, 0);
! 
!   /* Must clear the directory and volume bits, otherwise 214301 fails.
!      Unused bits left alone (some network redirectors use them).  Only
!      care about read-only attribute.  */
!   if (_chmod(mydirname, 1, (attr & 0xffe6) | ((mode & S_IWUSR) == 0)) == -1)
!     return -1;
    return 0;
  }
*** src/libc/ansi/stdio/_rename.c~0	Mon Nov  3 00:01:44 1997
--- src/libc/ansi/stdio/_rename.c	Fri Jul 10 15:45:40 1998
***************
*** 7,12 ****
--- 7,13 ----
  #include <unistd.h>
  #include <fcntl.h>
  #include <io.h>
+ #include <dos.h>
  #include <go32.h>
  #include <dpmi.h>
  #include <libc/dosio.h>
***************
*** 81,86 ****
--- 82,97 ----
    {
      if(use_lfn)
        r.x.ax = 0x7156;
+     else if ((_osmajor > 7 && _osmajor < 10) /* OS/2 returns v10 and above */
+ 	     || (_osmajor == 7 && _osminor >= 20))
+     {
+       /* DOS 7.20 (Windows 98) and later supports a new function with
+ 	 a maximum path length of 128 characters instead of 67.  This
+ 	 is important for deeply-nested directories.  */
+       r.x.ax = 0x43ff;
+       r.x.bp = 0x5053;
+       r.h.cl = 0x56;
+     }
      else
        r.h.ah = 0x56;
      _put_path2(new, olen);

- Raw text -


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