XBT_PUBLIC(sg_size_t) MSG_file_get_size(msg_file_t fd);
XBT_PUBLIC(void) MSG_file_dump(msg_file_t fd);
XBT_PUBLIC(msg_error_t) MSG_file_unlink(msg_file_t fd);
-XBT_PUBLIC(msg_error_t) MSG_file_seek(msg_file_t fd, sg_size_t offset, int origin);
+XBT_PUBLIC(msg_error_t) MSG_file_seek(msg_file_t fd, sg_offset_t offset, int origin);
XBT_PUBLIC(sg_size_t) MSG_file_tell (msg_file_t fd);
XBT_PUBLIC(void) __MSG_file_get_info(msg_file_t fd);
XBT_PUBLIC(void) __MSG_file_priv_free(msg_file_priv_t priv);
*/
typedef unsigned long long sg_size_t;
+/** @ingroup m_datatypes_management_details
+ * @brief Type for any simgrid offset
+ */
+typedef long long sg_offset_t;
+
/*
* Platform creation functions. Instead of passing 123 arguments to the creation functions
* (one for each possible XML attribute), we pass structures containing them all. It removes the
XBT_PUBLIC(sg_size_t) simcall_file_get_size(smx_file_t fd);
XBT_PUBLIC(xbt_dynar_t) simcall_file_get_info(smx_file_t fd);
XBT_PUBLIC(sg_size_t) simcall_file_tell(smx_file_t fd);
-XBT_PUBLIC(int) simcall_file_seek(smx_file_t fd, sg_size_t offset, int origin);
+XBT_PUBLIC(int) simcall_file_seek(smx_file_t fd, sg_offset_t offset, int origin);
XBT_PUBLIC(int) simcall_file_move(smx_file_t fd, const char* fullpath);
/***************************** Storage **********************************/
XBT_PUBLIC(sg_size_t) simcall_storage_get_free_size (smx_storage_t storage);
* - SEEK_END: end of the file
* @return MSG_OK if successful, otherwise MSG_TASK_CANCELED
*/
-XBT_PUBLIC(int) surf_workstation_file_seek(surf_resource_t workstation, surf_file_t fd, sg_size_t offset, int origin);
+XBT_PUBLIC(int) surf_workstation_file_seek(surf_resource_t workstation,
+ surf_file_t fd, sg_offset_t offset,
+ int origin);
/**
* @brief [brief description]
* MSG_TASK_CANCELED (=8).
*
*/
-msg_error_t MSG_file_seek(msg_file_t fd, sg_size_t offset, int origin)
+msg_error_t MSG_file_seek(msg_file_t fd, sg_offset_t offset, int origin)
{
msg_file_priv_t priv = MSG_file_priv(fd);
return simcall_file_seek(priv->simdata->smx_file, offset, origin);
file_unlink True (int) (fd, void*, smx_file_t)
file_get_size True (sg_size_t) (fd, void*, smx_file_t)
file_tell True (sg_size_t) (fd, void*, smx_file_t)
-file_seek True (int) (fd, void*, smx_file_t) (offset, sg_size_t) (origin, int)
+file_seek True (int) (fd, void*, smx_file_t) (offset, sg_offset_t) (origin, int)
file_get_info True (void*, xbt_dynar_t) (fd, void*, smx_file_t)
file_move True (int) (fd, void*, smx_file_t) (fullpath, const char*)
storage_get_free_size True (sg_size_t) (storage, void*, smx_storage_t)
,('TCPTR', 'const void*', 'cp')
,('TSIZE', 'size_t', 'sz')
,('TSGSIZE', 'sg_size_t', 'sgsz')
+ ,('TSGOFF', 'sg_offset_t', 'sgoff')
,('TVOID', 'void', '')
,('TDSPEC', 'void*', 'dp')
,('TFSPEC', 'FPtr', 'fp')]
return surf_workstation_get_info(host, fd->surf_file);
}
-int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_size_t offset, int origin)
+int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin)
{
return SIMIX_file_seek(simcall->issuer, fd, offset, origin);
}
-int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_size_t offset, int origin)
+int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin)
{
smx_host_t host = process->smx_host;
return surf_workstation_file_seek(host, fd->surf_file, offset, origin);
sg_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd);
sg_size_t SIMIX_pre_file_tell(smx_simcall_t simcall, smx_file_t fd);
xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd);
-int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_size_t offset, int origin);
+int SIMIX_pre_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
int SIMIX_pre_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host);
smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_size_t size, smx_host_t host);
sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
-int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_size_t offset, int origin);
+int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin);
int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath);
sg_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall,smx_storage_t storage);
double d;
size_t sz;
sg_size_t sgsz;
+ sg_offset_t sgoff;
void* dp;
FPtr fp;
const void* cp;
* \ingroup simix_file_management
*
*/
-int simcall_file_seek(smx_file_t fd, sg_size_t offset, int origin){
+int simcall_file_seek(smx_file_t fd, sg_offset_t offset, int origin){
return simcall_BODY_file_seek(fd, offset, origin);
}
return get_casted_workstation(workstation)->fileTell(fd);
}
-int surf_workstation_file_seek(surf_resource_t workstation, surf_file_t fd, sg_size_t offset, int origin){
+int surf_workstation_file_seek(surf_resource_t workstation, surf_file_t fd,
+ sg_offset_t offset, int origin){
return get_casted_workstation(workstation)->fileSeek(fd, offset, origin);
}
return fd->current_position;
}
-int Workstation::fileSeek(surf_file_t fd, sg_size_t offset, int origin){
+int Workstation::fileSeek(surf_file_t fd, sg_offset_t offset, int origin){
switch (origin) {
case SEEK_SET:
* - SEEK_END: end of the file
* @return MSG_OK if successful, otherwise MSG_TASK_CANCELED
*/
- virtual int fileSeek(surf_file_t fd, sg_size_t offset, int origin);
+ virtual int fileSeek(surf_file_t fd, sg_offset_t offset, int origin);
/**
* @brief Move a file to another location on the *same mount point*.