Add krb5_storage_fsync().
We add a function to cause krb5_storage's to be sync'd to their backing store. For memory backed storages, this is a NOP. For files, it calls fsync on the file descriptor.
This commit is contained in:
@@ -190,6 +190,25 @@ krb5_storage_truncate(krb5_storage *sp, off_t offset)
|
||||
return (*sp->trunc)(sp, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync the storage buffer to its backing store. If there is no
|
||||
* backing store this function will return success.
|
||||
*
|
||||
* @param sp the storage buffer to sync
|
||||
*
|
||||
* @return A Kerberos 5 error code
|
||||
*
|
||||
* @ingroup krb5_storage
|
||||
*/
|
||||
|
||||
KRB5_LIB_FUNCTION int KRB5_LIB_CALL
|
||||
krb5_storage_fsync(krb5_storage *sp)
|
||||
{
|
||||
if (sp->fsync != NULL)
|
||||
return sp->fsync(sp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read to the storage buffer.
|
||||
*
|
||||
|
Reference in New Issue
Block a user