2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

c7/f3.c File Reference


Detailed Description

File locking (lockf) [Sec. 7.11.3].

Definition in file f3.c.

Go to the source code of this file.

Compounds

struct  rec

Defines

#define DBNAME   "termdb"

Functions

bool readrec (int dbfd, struct rec *r, off_t off)
bool writerec (int dbfd, struct rec *r, off_t off)
bool store (int dbfd, int data)
void process1 (void)
void process2 (void)
int main (void)


Define Documentation

#define DBNAME   "termdb"
 

Definition at line 97 of file f3.c.


Function Documentation

int main void   ) 
 

Definition at line 155 of file f3.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, exit(), fork(), process1(), process2(), and waitpid().

void process1 void   )  [static]
 

Definition at line 99 of file f3.c.

References close(), DBNAME, EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, ec_neg1, exit(), open(), PERM_FILE, store(), and writerec().

void process2 void   )  [static]
 

Definition at line 116 of file f3.c.

References close(), DBNAME, EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_false, ec_neg1, errno, exit(), lockf(), lseek(), open(), rec::r_data, rec::r_next, and readrec().

bool readrec int  dbfd,
struct rec r,
off_t  off
 

Definition at line 29 of file f3.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, errno, and pread().

Referenced by process2(), and store().

bool store int  dbfd,
int  data
 

Definition at line 63 of file f3.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_false, ec_neg1, lockf(), lseek(), rec::r_data, rec::r_next, readrec(), usleep(), and writerec().

Referenced by process1().

bool writerec int  dbfd,
struct rec r,
off_t  off
 

Definition at line 46 of file f3.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, errno, and pwrite().

Referenced by process1(), and store().


Generated on Fri Apr 23 10:57:09 2004 for AUP2 Example Source by doxygen 1.3.1