lseekmark()
PROTOTYPE
#include <posix.h>
int lseekmark(int fid, int disable_update);
DESCRIPTION
lseekmark() is a non-standard routine that saves the current position of the open regular file specified by fid and controls whether later seeks overwrite the saved value. Seeks start from a file’s beginning, end, current position, or saved position, whichever is at or before the requested offset and the closest to it. By default, the current position is saved before each seek.
This usually gives good performance. However, when the current file position is an optimum starting point for later seeks, calling lseekmark() with disable_update non-zero updates the saved position and prevents it from being overwritten by later seeks.
To update the saved position and restore the default behavior, which updates the saved position before every seek, call lseekmark() with zero for disable_update. See Optimizing Seeks for more information.
If successful, lseekmark() returns 0. Otherwise, it sets errno and returns -1.
ERROR CODES
| EBADF | fid is not a valid open file descriptor. |
| EISDIR | The specified file is a directory. |
EXAMPLE
/*---------------------------------------------------------------*/
/* Save the starting position of the music header structure. */
/*---------------------------------------------------------------*/
lseekmark(fid, TRUE);