3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
28 * @ingroup FRAMEWORK/SYSTEM
29 * @brief This file contains the API for the status of devices.
36 * @addtogroup CAPI_SYSTEM_STORAGE_MODULE
40 #include <sys/statvfs.h>
41 #include "storage-expand.h"
44 * @fn int storage_get_internal_memory_size(struct statvfs *buf)
45 * @brief This generic API is used to get the internal memory size.
49 * @param[out] buf A pointer to a statvfs structure
50 * @return @c 0 on success,
51 * otherwise a negative error value on failure
57 * if (storage_get_internal_memory_size(&s) < 0)
58 * dlog_print(DLOG_DEBUG, LOG_TAG, "Fail to get internal memory size");
60 * dlog_print(DLOG_DEBUG, LOG_TAG, "Total mem : %lf, Avail mem : %lf",
61 * (double)s.f_frsize*s.f_blocks, (double)s.f_bsize*s.f_bavail);
65 #ifndef __USE_FILE_OFFSET64
66 extern int storage_get_internal_memory_size(struct statvfs *buf);
68 # define storage_get_internal_memory_size storage_get_internal_memory_size64
71 #ifdef __USE_FILE_OFFSET64
72 extern int storage_get_internal_memory_size64(struct statvfs *buf);
76 * @fn int storage_get_external_memory_size(struct statvfs *buf)
77 * @brief This generic API is used to get the external memory size.
81 * @param[out] buf A pointer to a statvfs structure
82 * @return @c 0 on success,
83 * otherwise a negative error value on failure
89 * if (storage_get_external_memory_size(&s) < 0)
90 * dlog_print(DLOG_DEBUG, LOG_TAG, "Fail to get external memory size");
92 * dlog_print(DLOG_DEBUG, LOG_TAG, "Total mem : %lf, Avail mem : %lf",
93 * (double)s.f_frsize*s.f_blocks, (double)s.f_bsize*s.f_bavail);
97 #ifndef __USE_FILE_OFFSET64
98 extern int storage_get_external_memory_size(struct statvfs *buf);
100 # ifdef __REDIRECT_NTH
101 extern int __REDIRECT_NTH (storage_get_external_memory_size,
102 (struct statvfs *buf), storage_get_external_memory_size64)
105 # define storage_get_external_memory_size storage_get_external_memory_size64
109 #ifdef __USE_FILE_OFFSET64
110 extern int storage_get_external_memory_size64(struct statvfs *buf);