summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2019-04-12 03:22:21 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2019-04-12 03:22:21 (GMT)
commit2eac0fccbc0fa1a38364ab5cb818483379a2668b (patch)
treee542cd31e7e4dba03c9e81e7923c6cfa1959032d /src/H5F.c
parent52276f3713eec584044bc72d4724507848cfeba0 (diff)
downloadhdf5-2eac0fccbc0fa1a38364ab5cb818483379a2668b.zip
hdf5-2eac0fccbc0fa1a38364ab5cb818483379a2668b.tar.gz
hdf5-2eac0fccbc0fa1a38364ab5cb818483379a2668b.tar.bz2
Add H5Fget_fileno() API routine.
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 9df8140..e873652 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -921,6 +921,41 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5Fget_fileno
+ *
+ * Purpose: Public API to retrieve the file's 'file number' that uniquely
+ * identifies each open file.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Fget_fileno(hid_t file_id, unsigned long *fileno)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_API(FAIL)
+
+ /* If no fileno pointer was passed in, exit quietly */
+ if(fileno) {
+ H5VL_object_t *vol_obj; /* File info */
+
+ /* Get the internal file structure */
+ if(NULL == (vol_obj = (H5VL_object_t *)H5I_object(file_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier")
+
+ /* Get the flags */
+ if((ret_value = H5VL_file_get(vol_obj, H5VL_FILE_GET_FILENO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, fileno)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file's 'file number'")
+ } /* end if */
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Fget_fileno() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5Fget_freespace
*
* Purpose: Retrieves the amount of free space in the file.