Mercurial > hg > Members > kono > nitros9-code
view docs/ccguide/lseek.refentry @ 2772:0a3f4d8ea6d5
Found ENDC in wrong location in dwread.asm and dwwrite.asm. Corrected.
Moved the native 6309 code in dwread.asm and dwwrite.asm into the H6309 labeled area and changed IFEQ H6309 to IFNE H6309. Also moved the 57600bps 6809 code to the default location. This change had been done in the old dwread.asm and dwwrite.asm files to make it easier to follow. Though these two files were overwritten from the HDBDOS project dwread.asm and dwwrite.asm files. So this conversion needed to be done again so it made the source easier to follow.
author | drencor-xeen |
---|---|
date | Wed, 23 Jan 2013 12:36:55 -0600 |
parents | 42b2c775f05f |
children |
line wrap: on
line source
<refentry id="lseek"> <refnamediv> <refname>Lseek</refname> <refpurpose>position in file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef><function>lseek</function></funcdef> <paramdef>int <parameter>pn</parameter></paramdef> <paramdef>long <parameter>position</parameter></paramdef> <paramdef>int <parameter>type</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1><title>Assembler Equivalent</title> <para> os9 I$SEEK </para> </refsect1> <refsect1><title>Description</title> <para> The read or write pointer for the open file with the path number, "pn", is positioned by lseek to the specified place in the file. The "type" indicates from where "position" is to be measured: if 0, from the beginning of the file, if 1, from the current location, or if 2, from the end of the file. </para> <para> Seeking to a location beyond the end of a file open for writing and then writing to it, creates a "hole" in the file which appears to be filled with zeros from the previous end to the position sought. </para> <para> The returned value is the resulting position in the file unless there is an error, so to find out the current position use <informalexample> <para> lseek(pn,0l,1); </para> </informalexample> </para> </refsect1> <refsect1><title>Caveats</title> <para> The argument "position" <emphasis>must</emphasis> be a long integer. Constants should be explicitly made long by appending an "l", as above, and other types should be converted using a cast: <informalexample> <para> e.g. lseek(pn,(long)pos,1); </para> </informalexample> Notice also, that the return value from lseek is itself a long integer. </para> </refsect1> <refsect1><title>Diagnostics</title> <para> -1 is returned if "pn" is a bad path number, or attempting to seek to a position before the beginning of a file. </para> </refsect1> <refsect1><title>See Also</title> <para> <link linkend="creat">creat()</link>, <link linkend="open">open()</link>, Standard Library function <link linkend="fseek">"fseek"</link> </para> </refsect1> </refentry>