VERITAS File System 4.1 Administrator's Guide

File Change Log
File Change Log Programmatic Interface
Chapter 8 135
File Change Log Programmatic Interface
The standard system calls open(2), lseek(2), read(2) and close(2) can be used on the
FCL file at mount_point/lost+found/changelog. Only one programmatic interface is
exposed through libvxfsutil, the vxfsu_fcl_sync API (see the vxfsu_fcl_sync(3) manual
page). The prototype is available at /opt/VRTSfssdk/4.0/include/vxfsutil.h.
The following sample code fragment reads the FCL superblock, checks that the state of the
FCL is VX_FCLS_ON, issues a call to vxfsu_fcl_sync to obtain a finishing offset to read to,
determines the first valid offset in the FCL file, then reads the entries in 8K chunks from this
offset. The section process fcl entries is what an application developer must supply to process
the entries in the FCL.
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
#include <fcl.h>
#include <vxfsutil.h>
#define FCL_READSZ 8192
char* fclname = "/mnt/lost+found/changelog";
int
read_fcl(fclname)
char* fclname;
{
struct fcl_sb fclsb;
uint64_t off, lastoff;
size_t size;
char buf[FCL_READSZ], *bufp = buf;
int fd;
int err = 0;