From: pavenis AT lanet DOT lv To: "Andrew Cottrell" , Date: Wed, 15 Aug 2001 16:56:57 +0300 MIME-Version: 1.0 Content-type: Multipart/Mixed; boundary=Message-Boundary-26866 Subject: Re: Selector Exhaustion Message-ID: <3B7AA9D9.8107.57F386@localhost> In-reply-to: <010d01c1258c$b31d8530$0a02a8c0@acceleron> X-mailer: Pegasus Mail for Win32 (v3.12c) Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --Message-Boundary-26866 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body On 15 Aug 2001, at 23:17, Andrew Cottrell wrote: > I applied the patch and have for the first time fully re-built LIBC on my > Win 98 box without it stopping. The same for me > I had one problem in applying the patch to the source code from the > 12-Aug-2001 CVS tarball, patch rejected the change at line 157. I cannot > couldn't find any differences betwern the line from CVS and the diff file > after I removed the first two characters of the diff file. I checked with a > hex viewer and could see any diffreneces. The info on the failure is below. > I was using patch version 2.5.3. The other chunk was applied correctly. > > Any ideas on what may cause this? I tried again and again and it keeps on > failing and I can't see why. Pegasus Mail 3.12c have messed up diffs (converted somewhere \t to spaces). Now I'm sending latest one (some small updates and comments) as attachment Andris --Message-Boundary-26866 Content-type: text/plain; charset=US-ASCII Content-disposition: inline Content-description: Attachment information. The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any another MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. ---- File information ----------- File: dosexec.c.diff Date: 14 Aug 2001, 12:42 Size: 2393 bytes. Type: Text --Message-Boundary-26866 Content-type: Application/Octet-stream; name="dosexec.c.diff"; type=Text Content-disposition: attachment; filename="dosexec.c.diff" *** djgpp/src/libc/dos/process/dosexec.c~1 Mon Jul 30 14:35:52 2001 --- djgpp/src/libc/dos/process/dosexec.c Tue Aug 14 12:42:24 2001 *************** size_t __cmdline_str_len = sizeof(__cmdl *** 157,163 **** if LFN is 2, there is a possiblity that the contents of the transfer buffer will be overrun! */ static int ! direct_exec_tail(const char *program, const char *args, char * const envp[], const char *proxy, int lfn, const char *cmdline_var) { --- 157,163 ---- if LFN is 2, there is a possiblity that the contents of the transfer buffer will be overrun! */ static int ! direct_exec_tail_1 (const char *program, const char *args, char * const envp[], const char *proxy, int lfn, const char *cmdline_var) { *************** direct_exec_tail(const char *program, co *** 413,418 **** --- 413,469 ---- return r.h.al; /* AL holds the child exit code */ } + + + static int direct_exec_tail (const char *program, const char *args, + char * const envp[], const char *proxy, int lfn, + const char *cmdline_var) + { + int i, ret; + int sel1=0, sel2=0; + char desc_map[8192]; + int is_nt = (_osmajor==5 && _osminor==0 && _get_dos_version(1)==0x0532) ? + 1 : 0; + if (is_nt) + { + sel1 = __dpmi_allocate_ldt_descriptors (1); + } + else + { + char * map = desc_map; + for (i=0x0000007; i<0x00010000; i+=8) + { /* FIXME: Use __dpmi_get_selector_increment_value() instead of 8 ? */ + *map++ = (__dpmi_get_descriptor_access_rights(i) & 0x80) ? 0 : 1; + } + } + + ret = direct_exec_tail_1 ( program, args, envp, proxy, lfn, cmdline_var ); + + if (is_nt) + { + sel2 = __dpmi_allocate_ldt_descriptors (1); + if (sel1>_dos_ds && sel2>_dos_ds) + { + for (i=sel2; i>=sel1; i-=8) + __dpmi_free_ldt_descriptor (i); + } + } + else + { + char * map = desc_map; + for (i=0x0000007; i<0x00010000; i+=8) + { + if (*map++) + { + if (__dpmi_get_descriptor_access_rights(i) & 0x80) + __dpmi_free_ldt_descriptor (i); + } + } + } + return ret; + } + + int _dos_exec(const char *program, const char *args, char * const envp[], const char *cmdline_var) --Message-Boundary-26866--