summaryrefslogtreecommitdiff
path: root/libsysfs
diff options
context:
space:
mode:
Diffstat (limited to 'libsysfs')
-rw-r--r--libsysfs/sysfs_dir.c4
-rw-r--r--libsysfs/sysfs_utils.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/libsysfs/sysfs_dir.c b/libsysfs/sysfs_dir.c
index ff2edf4615..e983d0eff4 100644
--- a/libsysfs/sysfs_dir.c
+++ b/libsysfs/sysfs_dir.c
@@ -266,7 +266,11 @@ int sysfs_read_attribute(struct sysfs_attribute *sysattr)
sysattr->path);
return -1;
}
+#ifdef __KLIBC__
+ pgsize = 0x4000;
+#else
pgsize = getpagesize();
+#endif
fbuf = (unsigned char *)calloc(1, pgsize+1);
if (fbuf == NULL) {
dprintf("calloc failed\n");
diff --git a/libsysfs/sysfs_utils.c b/libsysfs/sysfs_utils.c
index 4475342433..f1303cacb3 100644
--- a/libsysfs/sysfs_utils.c
+++ b/libsysfs/sysfs_utils.c
@@ -22,6 +22,9 @@
*/
#include "libsysfs.h"
#include "sysfs.h"
+#ifndef __KLIBC__
+#include <mntent.h>
+#endif
/**
* sysfs_get_mnt_path: Gets the mount point for specified filesystem.
@@ -33,6 +36,10 @@
static int sysfs_get_fs_mnt_path(const unsigned char *fs_type,
unsigned char *mnt_path, size_t len)
{
+#ifdef __KLIBC__
+ strcpy(mnt_path, "/sys");
+ return 0;
+#else
FILE *mnt;
struct mntent *mntent;
int ret = 0;
@@ -66,6 +73,7 @@ static int sysfs_get_fs_mnt_path(const unsigned char *fs_type,
ret = -1;
}
return ret;
+#endif
}
/*