This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[AArch64] Set errno in ftruncate() and truncate().


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]