This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] ARM set errno in ftruncate and truncate stubs.
- From: Marcus Shawcroft <marcus dot shawcroft at arm dot com>
- To: newlib at sourceware dot org
- Date: Wed, 20 Nov 2013 17:53:08 +0000
- Subject: [PATCH] ARM set errno in ftruncate and truncate stubs.
- Authentication-results: sourceware.org; auth=none
Ensure errno gets set by the ftruncate() and truncate() stubs.
OK?
/Marcus
2013-11-20 Marcus Shawcroft <marcus.shawcroft@arm.com>
* arm/ftruncate.c: Include errno.h.
(ftruncate) Set errno.
* arm/truncate.c: Include errno.h.
(truncate) Set errno.
diff --git a/libgloss/arm/ftruncate.c b/libgloss/arm/ftruncate.c
index da46fc5..41a64d2 100644
--- a/libgloss/arm/ftruncate.c
+++ b/libgloss/arm/ftruncate.c
@@ -23,10 +23,12 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+#include <errno.h>
#include <sys/types.h>
int
ftruncate (int file, off_t length)
{
+ errno = ENOSYS;
return -1;
}
diff --git a/libgloss/arm/truncate.c b/libgloss/arm/truncate.c
index d53394a..92c0fca 100644
--- a/libgloss/arm/truncate.c
+++ b/libgloss/arm/truncate.c
@@ -23,10 +23,12 @@
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+#include <errno.h>
#include <sys/types.h>
int
truncate (const char *path, off_t length)
{
+ errno = ENOSYS;
return -1;
}
--
1.7.9.5