aboutsummaryrefslogtreecommitdiff
path: root/inc/powercap.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/powercap.h')
-rw-r--r--inc/powercap.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/inc/powercap.h b/inc/powercap.h
index 814b296..9e4c0ec 100644
--- a/inc/powercap.h
+++ b/inc/powercap.h
@@ -121,6 +121,7 @@ int powercap_constraint_file_get_name(powercap_constraint_file type, uint32_t co
* Returns a negative value in case of other error.
*/
int powercap_get_path(const char* control_type_name, const uint32_t* zones, uint32_t depth, char* buf, size_t size);
+
/**
* Get the full path to a control type file.
* Return is like snprintf, except if the output was truncated due to the size limit, the return value is still > size,
@@ -130,6 +131,7 @@ int powercap_get_path(const char* control_type_name, const uint32_t* zones, uint
*/
int powercap_control_type_file_get_path(powercap_control_type_file type, const char* control_type_name, char* buf,
size_t size);
+
/**
* Get the full path to a zone file.
* Return is like snprintf, except if the output was truncated due to the size limit, the return value is still > size,
@@ -152,6 +154,31 @@ int powercap_constraint_file_get_path(powercap_constraint_file type, const char*
size_t size);
/**
+ * Open a control type file.
+ * Returns the file descriptor from the open function and assigns it to the powercap_control_type (if not NULL).
+ * Also returns a negative value in case of other errors, like bad parameters.
+ */
+int powercap_control_type_file_open(powercap_control_type* control, powercap_control_type_file type,
+ const char* control_type_name, int flags);
+
+/**
+ * Open a zone file.
+ * Returns the file descriptor from the open function and assigns it to the powercap_zone (if not NULL).
+ * Also returns a negative value in case of other errors, like bad parameters.
+ */
+int powercap_zone_file_open(powercap_zone* zone, powercap_zone_file type, const char* control_type_name,
+ const uint32_t* zones, uint32_t depth, int flags);
+
+/**
+ * Open a constraint file.
+ * Returns the file descriptor from the open function and assigns it to the powercap_constraint (if not NULL).
+ * Also returns a negative value in case of other errors, like bad parameters.
+ */
+int powercap_constraint_file_open(powercap_constraint* constraint, powercap_constraint_file type,
+ const char* control_type_name, const uint32_t* zones, uint32_t depth,
+ uint32_t constraint_num, int flags);
+
+/**
* Set the control type's enabled value.
*/
int powercap_control_type_set_enabled(const powercap_control_type* control, int val);