[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/build/uClibc/libc/misc/mntent/.indent.pro b/ap/build/uClibc/libc/misc/mntent/.indent.pro
new file mode 100644
index 0000000..492ecf1
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/mntent/.indent.pro
@@ -0,0 +1,33 @@
+--blank-lines-after-declarations
+--blank-lines-after-procedures
+--break-before-boolean-operator
+--no-blank-lines-after-commas
+--braces-on-if-line
+--braces-on-struct-decl-line
+--comment-indentation25
+--declaration-comment-column25
+--no-comment-delimiters-on-blank-lines
+--cuddle-else
+--continuation-indentation4
+--case-indentation0
+--else-endif-column33
+--space-after-cast
+--line-comments-indentation0
+--declaration-indentation1
+--dont-format-first-column-comments
+--dont-format-comments
+--honour-newlines
+--indent-level4
+/* changed from 0 to 4 */
+--parameter-indentation4
+--line-length78 /* changed from 75 */
+--continue-at-parentheses
+--no-space-after-function-call-names
+--dont-break-procedure-type
+--dont-star-comments
+--leave-optional-blank-lines
+--dont-space-special-semicolon
+--tab-size4
+/* additions by Mark */
+--case-brace-indentation0
+--leave-preprocessor-space
diff --git a/ap/build/uClibc/libc/misc/mntent/Makefile b/ap/build/uClibc/libc/misc/mntent/Makefile
new file mode 100644
index 0000000..4a8f4a0
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/mntent/Makefile
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+top_srcdir=../../../
+top_builddir=../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.in
+include $(top_srcdir)Makerules
diff --git a/ap/build/uClibc/libc/misc/mntent/Makefile.in b/ap/build/uClibc/libc/misc/mntent/Makefile.in
new file mode 100644
index 0000000..daa888d
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/mntent/Makefile.in
@@ -0,0 +1,23 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+subdirs += libc/misc/mntent
+
+CSRC := mntent.c
+
+MISC_MNTENT_DIR := $(top_srcdir)libc/misc/mntent
+MISC_MNTENT_OUT := $(top_builddir)libc/misc/mntent
+
+MISC_MNTENT_SRC := $(MISC_MNTENT_DIR)/mntent.c
+MISC_MNTENT_OBJ := $(MISC_MNTENT_OUT)/mntent.o
+
+libc-y += $(MISC_MNTENT_OBJ)
+
+objclean-y += CLEAN_libc/misc/mntent
+
+CLEAN_libc/misc/mntent:
+ $(do_rm) $(addprefix $(MISC_MNTENT_OUT)/*., o os)
diff --git a/ap/build/uClibc/libc/misc/mntent/mntent.c b/ap/build/uClibc/libc/misc/mntent/mntent.c
new file mode 100644
index 0000000..608f84c
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/mntent/mntent.c
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <mntent.h>
+#include <bits/uClibc_mutex.h>
+
+__UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
+
+
+
+/* Reentrant version of getmntent. */
+struct mntent *getmntent_r (FILE *filep,
+ struct mntent *mnt, char *buff, int bufsize)
+{
+ static const char sep[] = " \t\n";
+
+ char *cp, *ptrptr;
+
+ if (!filep || !mnt || !buff)
+ return NULL;
+
+ /* Loop on the file, skipping comment lines. - FvK 03/07/93 */
+ while ((cp = fgets(buff, bufsize, filep)) != NULL) {
+ if (buff[0] == '#' || buff[0] == '\n')
+ continue;
+ break;
+ }
+
+ /* At the EOF, the buffer should be unchanged. We should
+ * check the return value from fgets ().
+ */
+ if (cp == NULL)
+ return NULL;
+
+ ptrptr = 0;
+ mnt->mnt_fsname = strtok_r(buff, sep, &ptrptr);
+ if (mnt->mnt_fsname == NULL)
+ return NULL;
+
+ mnt->mnt_dir = strtok_r(NULL, sep, &ptrptr);
+ if (mnt->mnt_dir == NULL)
+ return NULL;
+
+ mnt->mnt_type = strtok_r(NULL, sep, &ptrptr);
+ if (mnt->mnt_type == NULL)
+ return NULL;
+
+ mnt->mnt_opts = strtok_r(NULL, sep, &ptrptr);
+ if (mnt->mnt_opts == NULL)
+ mnt->mnt_opts = "";
+
+ cp = strtok_r(NULL, sep, &ptrptr);
+ mnt->mnt_freq = (cp != NULL) ? atoi(cp) : 0;
+
+ cp = strtok_r(NULL, sep, &ptrptr);
+ mnt->mnt_passno = (cp != NULL) ? atoi(cp) : 0;
+
+ return mnt;
+}
+libc_hidden_def(getmntent_r)
+
+struct mntent *getmntent(FILE * filep)
+{
+ struct mntent *tmp;
+ static char *buff = NULL;
+ static struct mntent mnt;
+ __UCLIBC_MUTEX_LOCK(mylock);
+
+ if (!buff) {
+ buff = malloc(BUFSIZ);
+ if (!buff)
+ abort();
+ }
+
+ tmp = getmntent_r(filep, &mnt, buff, BUFSIZ);
+ __UCLIBC_MUTEX_UNLOCK(mylock);
+ return(tmp);
+}
+
+int addmntent(FILE * filep, const struct mntent *mnt)
+{
+ if (fseek(filep, 0, SEEK_END) < 0)
+ return 1;
+
+ return (fprintf (filep, "%s %s %s %s %d %d\n", mnt->mnt_fsname, mnt->mnt_dir,
+ mnt->mnt_type, mnt->mnt_opts, mnt->mnt_freq, mnt->mnt_passno) < 0 ? 1 : 0);
+}
+
+char *hasmntopt(const struct mntent *mnt, const char *opt)
+{
+ return strstr(mnt->mnt_opts, opt);
+}
+
+FILE *setmntent(const char *name, const char *mode)
+{
+ return fopen(name, mode);
+}
+libc_hidden_def(setmntent)
+
+int endmntent(FILE * filep)
+{
+ if (filep != NULL)
+ fclose(filep);
+ return 1;
+}
+libc_hidden_def(endmntent)