Mail Archives: djgpp/1999/03/11/05:55:34
On Wed, 10 Mar 1999, Junior System Administrator wrote:
> 1). Can I lock regions of memory in DJGPP without using assembly ?
Of course. Use either __dpmi_lock_linear_region or
_go32_dpmi_lock_code and _go32_dpmi_lock_data.
> 2). Is there a portable way (conforming to the ANSI standard) to get
> the mode of an already open file (opened with 'fopen()'). Is
> there a function, or a field within the 'FILE *' type, that can
> tell me ?
What exactly do you mean by ``mode''? If you mean text/binary mode,
then use `setmode' and pass it fileno(fp), where fp is a FILE * result
returned by `fopen'.
If you mean the read/write etc. mode bits, use fstat with the same
fileno(fp) as an argument.
Neither of these is ANSI, but `fstat' is Posix. Both have serious
portability problems either to other DOS/Windows compilers (fstat and
setmode) or to Unix (setmode).
- Raw text -