wok rev 20548

linld: fix open_image
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 01 16:48:25 2018 +0100 (11 days ago)
parents cbf4455443d3
children 014e68d6a0ef
files linld/stuff/src/CRTL.ASM linld/stuff/src/CRTL.H linld/stuff/src/CRTLX.H
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Sat Dec 01 13:00:11 2018 +0100
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Sat Dec 01 16:48:25 2018 +0100
     1.3 @@ -279,11 +279,11 @@
     1.4          endp    @read$qipvi
     1.5  
     1.6  ;***************************************************************
     1.7 -;_fastcall long lseekset(int fd, unsigned sz);
     1.8 -;_fastcall long lseekcur(int fd, int while);
     1.9 +;_fastcall long lseekset(int fd, unsigned whence);
    1.10 +;_fastcall long lseekcur(int fd, int whence);
    1.11  ;***************************************************************
    1.12  
    1.13 -        global  @lseekcur$qii:near
    1.14 +        global  @lseekcur$qii:near		; fd=ax whence=dx
    1.15          proc    @lseekcur$qii near
    1.16  
    1.17  		xchg	ax,bx
    1.18 @@ -311,7 +311,7 @@
    1.19  lseekx:
    1.20  		xchg	ax,bx
    1.21  lseek:
    1.22 -		mov	ah,42h
    1.23 +		mov	ah,42h			; bx=fd cx:dx=offset al=whence
    1.24  		jmp	dos
    1.25  
    1.26          endp    @lseekcur$qii
    1.27 @@ -342,7 +342,7 @@
    1.28  		mov	dx,[bx]
    1.29  		mov	cx,[bx+2]
    1.30  		extrn	_isostate:isostate
    1.31 -		mov	bx,[_isostate.fd]
    1.32 +		mov	ax,[_isostate.fd]
    1.33  		jmp	lseekset
    1.34  
    1.35  	endp	@isolseek$qpxul
    1.36 @@ -502,9 +502,9 @@
    1.37  @@die:
    1.38  		mov	bx,[(image_himem di).errmsg]
    1.39  		jc	die
    1.40 -		mov	bx,[(image_himem di).fd]
    1.41  		ifndef	NO386
    1.42  		push	eax
    1.43 +		mov	ax,[(image_himem di).fd]
    1.44  		call	rewind
    1.45  		pop	eax
    1.46  @@end:
    1.47 @@ -512,6 +512,7 @@
    1.48  		else
    1.49  		push	ax
    1.50  		push	dx
    1.51 +		mov	ax,[(image_himem di).fd]
    1.52  		call	rewind
    1.53  		pop	dx
    1.54  		pop	ax
     2.1 --- a/linld/stuff/src/CRTL.H	Sat Dec 01 13:00:11 2018 +0100
     2.2 +++ b/linld/stuff/src/CRTL.H	Sat Dec 01 16:48:25 2018 +0100
     2.3 @@ -35,7 +35,7 @@
     2.4  extern _fastcall int open(const char* name);
     2.5  extern _fastcall int close(int fd);
     2.6  extern _fastcall int read(int fd, void* data, int sz);
     2.7 -extern _fastcall long lseekcur(int fd, int where);
     2.8 +extern _fastcall long lseekcur(int fd, int whence);
     2.9  extern _fastcall int puts(const char* s);
    2.10  extern pascal unsigned long strtol(const char *s);
    2.11  
     3.1 --- a/linld/stuff/src/CRTLX.H	Sat Dec 01 13:00:11 2018 +0100
     3.2 +++ b/linld/stuff/src/CRTLX.H	Sat Dec 01 16:48:25 2018 +0100
     3.3 @@ -1,6 +1,6 @@
     3.4  // This file is distributed under GPL
     3.5  //
     3.6 -extern _fastcall long lseekset(int fd, unsigned sz);
     3.7 +extern _fastcall long lseekset(int fd, unsigned whence);
     3.8  extern _fastcall void strcpy(const char* a,const char* b);
     3.9  extern _fastcall void strcat(const char* a,const char* b);
    3.10  extern _fastcall int strcmp(const char* a,const char* b);