This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[AArch64] Set errno in ftruncate() and truncate().
- From: Marcus Shawcroft <marcus dot shawcroft at arm dot com>
- To: newlib at sourceware dot org
- Date: Thu, 21 Nov 2013 15:53:27 +0000
- Subject: [AArch64] Set errno in ftruncate() and truncate().
- Authentication-results: sourceware.org; auth=none
Ensure errno is set by ftruncate() and truncate() stubs. This is the
AArch64 equivalent of this patch:
https://sourceware.org/ml/newlib/2013/msg00933.html
Committed.
/Marcus
2013-11-21 Marcus Shawcroft <marcus.shawcroft@arm.com>
* aarch64/ftruncate.c: Include errno.h.
(ftruncate) Set errno.
* aarch64/truncate.c: Include errno.h.
(truncate) Set errno.
diff --git a/libgloss/aarch64/ftruncate.c b/libgloss/aarch64/ftruncate.c
index da46fc5..41a64d2 100644
--- a/libgloss/aarch64/ftruncate.c
+++ b/libgloss/aarch64/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/aarch64/truncate.c b/libgloss/aarch64/truncate.c
index d53394a..92c0fca 100644
--- a/libgloss/aarch64/truncate.c
+++ b/libgloss/aarch64/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