/builddir/build/BUILD/gfal2-2.0.0/src/common/gfal_common_filedescriptor.c File Reference

file for the file descriptor management More...

#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <pthread.h>
#include "gfal_common_errverbose.h"
#include "gfal_types.h"
#include "gfal_common_filedescriptor.h"

Functions

int gfal_add_new_file_desc (gfal_fdesc_container_handle fhandle, gpointer pfile, GError **err)
gpointer gfal_get_file_desc (gfal_fdesc_container_handle fhandle, int key, GError **err)
gboolean gfal_remove_file_desc (gfal_fdesc_container_handle fhandle, int key, GError **err)
gfal_fdesc_container_handle gfal_file_descriptor_handle_create (GDestroyNotify destroyer)
gfal_file_handle gfal_file_handle_new (const char *module_name, gpointer fdesc)
gfal_file_handle gfal_file_handle_ext_new (const char *module_name, gpointer fdesc, gpointer ext_data)
gfal_file_handle gfal_file_handle_bind (gfal_fdesc_container_handle h, int file_desc, GError **err)
void gfal_file_handle_lock (gfal_file_handle fh)
void gfal_file_handle_unlock (gfal_file_handle fh)
void gfal_file_handle_delete (gfal_file_handle fh)

Detailed Description

file for the file descriptor management

Author:
Devresse Adrien
Version:
2.0
Date:
22/05/2011

Function Documentation

int gfal_add_new_file_desc ( gfal_fdesc_container_handle  fhandle,
gpointer  pfile,
GError **  err 
)

Add the given file handle to the and return a file descriptor

Returns:
return the associated key if success else 0 and set err
gfal_file_handle gfal_file_handle_bind ( gfal_fdesc_container_handle  h,
int  file_desc,
GError **  err 
)

return the file handle associated with the file_desc

Warning:
does not free the handle

References gfal_get_file_desc().

Referenced by gfal_posix_internal_lseek(), gfal_posix_internal_pread(), gfal_posix_internal_pwrite(), gfal_posix_internal_read(), gfal_posix_internal_readdir(), and gfal_posix_internal_write().

void gfal_file_handle_delete ( gfal_file_handle  fh  ) 

Delete a gfal_file handle

*

gfal_file_handle gfal_file_handle_ext_new ( const char *  module_name,
gpointer  fdesc,
gpointer  ext_data 
)

same than gfal_file_handle but with external data storage support

gpointer gfal_get_file_desc ( gfal_fdesc_container_handle  fhandle,
int  key,
GError **  err 
)

return the associated file handle for the given file descriptor or NULL if the key is not present and err is set

Referenced by gfal_file_handle_bind().

gboolean gfal_remove_file_desc ( gfal_fdesc_container_handle  fhandle,
int  key,
GError **  err 
)

remove the associated file handle associated with the given file descriptor return true if success else false


Generated on 15 May 2012 for CERN org.glite.Gfal by  doxygen 1.6.1