OSDN Git Service

Add extra libc stubs for mntent related functions.
authorJP Abgrall <jpa@google.com>
Thu, 9 Jan 2014 22:06:20 +0000 (14:06 -0800)
committerJP Abgrall <jpa@google.com>
Fri, 10 Jan 2014 01:24:34 +0000 (01:24 +0000)
This adds stubs for setmntent() and endmntent().

Change-Id: I6ccaa044145405cd7226c1c54a25d435c96a2308

libc/bionic/stubs.cpp
libc/include/mntent.h

index 6edaa19..707036a 100644 (file)
@@ -447,6 +447,16 @@ mntent* getmntent(FILE* /*f*/) {
   return NULL;
 }
 
+FILE* setmntent(const char*, const char*) {
+  UNIMPLEMENTED;
+  return NULL;
+}
+
+int endmntent(FILE*) {
+  UNIMPLEMENTED;
+  return 1; /* Allways returns 1 according to man */
+}
+
 char* ttyname(int /*fd*/) { // NOLINT: implementing bad function.
   UNIMPLEMENTED;
   return NULL;
index 8b87f71..6cc0b18 100644 (file)
@@ -30,7 +30,9 @@
 
 #include <stdio.h>
 #include <sys/cdefs.h>
+#include <paths.h>  /* for _PATH_MOUNTED */
 
+#define MOUNTED _PATH_MOUNTED
 #define MNTTYPE_IGNORE "ignore"
 
 struct mntent
@@ -48,6 +50,8 @@ __BEGIN_DECLS
 
 
 struct mntent* getmntent(FILE*);
+FILE* setmntent(const char*, const char*);
+int endmntent(FILE*);
 
 __END_DECLS