Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The file module has functions lock files across several operations that are almost exact equivalents to POSIX API functions (see Listing - File Module Function and Listing - POSIX API Equivalent); the primary difference is the advantage of valuable return error codes to the application.

...


Code Block

...

language

...

rowspan7

...

cpp
titleListing - File Module Function

...

linenumbers

...

true
void FSFile_LockGet    (FS_FILE *p_file,

...


                        FS_ERR  *p_err);

...


void FSFile_LockAccept (FS_FILE *p_file,

...


                        FS_ERR  *p_err);

...


void FSFile_LockSet    (FS_FILE *p_file,

...


                        FS_ERR  *p_err);

...



Code Block

...

language

...

cpp

...

titleListing - POSIX API Equivalent

...

linenumbers

...

true
void fs_flockfile    (FS_FILE *file);

...



int  fs_ftrylockfile (FS_FILE *file);

...



void fs_funlockfile  (FS_FILE *file);

...


For more information about and an example of using file locking, see

...

...