2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef included_linux_sysfs_h
17 #define included_linux_sysfs_h
19 #include <vppinfra/error.h>
21 clib_error_t *clib_sysfs_write (char *file_name, char *fmt, ...);
23 clib_error_t *clib_sysfs_read (char *file_name, char *fmt, ...);
25 u8 *clib_sysfs_link_to_name (char *link);
27 clib_error_t *clib_sysfs_set_nr_hugepages (int numa_node,
28 int page_size, int nr);
29 clib_error_t *clib_sysfs_get_nr_hugepages (int numa_node,
30 int page_size, int *v);
31 clib_error_t *clib_sysfs_get_free_hugepages (int numa_node,
32 int page_size, int *v);
33 clib_error_t *clib_sysfs_get_surplus_hugepages (int numa_node,
34 int page_size, int *v);
35 clib_error_t *clib_sysfs_prealloc_hugepages (int numa_node,
36 int page_size, int nr);
38 #endif /* included_linux_sysfs_h */
41 * fd.io coding-style-patch-verification: ON
44 * eval: (c-set-style "gnu")