aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Yuste <dyuste@gcc.gnu.org>2011-02-17 09:13:19 +0000
committerDavid Yuste <dyuste@gcc.gnu.org>2011-02-17 09:13:19 +0000
commite75b6e40c3bda1400788808429e64453379f8bcb (patch)
treed8b3bebc3a9039c05f7f642383c42cb321c74743
parenta26a1b777445f25b60cbeea48cd327c2a83f5707 (diff)
Added file (previously forgotten)
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/st/cli-be@170243 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstd/src/unlink.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/libstd/src/unlink.c b/libstd/src/unlink.c
new file mode 100644
index 00000000000..209805ea948
--- /dev/null
+++ b/libstd/src/unlink.c
@@ -0,0 +1,47 @@
+/*
+
+ Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Contributed by STMicroelectronics
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* If we are compiling this, we are sure this is to build C-runtime*/
+#define __LIBSTD_CRT_BUILD
+
+#include <__cdefs.h>
+#include <__host.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "__io.h"
+
+LIBSTD_LPROTO_IMPL(int, unlink, const char * name)
+{
+ int res = LIBSTD_HNAME(unlink)(name);
+
+ if (res == -1) {
+ /* FIXME: check the actual error code */
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+