* Correct (f)truncate64 implementation
@ 1999-12-18 3:05 Andreas Jaeger
0 siblings, 0 replies; only message in thread
From: Andreas Jaeger @ 1999-12-18 3:05 UTC (permalink / raw)
To: GNU libc hacker
(f)truncate64 doesn't save errno, it might be changed to ENOSYS if
(f)truncate64 is not available but the syscalls are compiled in.
Andreas
1999-12-18 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/ftruncate64.c (ftruncate64): Save and
set errno.
* sysdeps/unix/sysv/linux/truncate64.c (truncate64): Likewise.
============================================================
Index: sysdeps/unix/sysv/linux/ftruncate64.c
--- sysdeps/unix/sysv/linux/ftruncate64.c 1999/12/09 00:18:13 1.3
+++ sysdeps/unix/sysv/linux/ftruncate64.c 1999/12/18 11:01:07
@@ -43,6 +43,9 @@
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+ int saved_errno = errno;
+#endif
int result = INLINE_SYSCALL (ftruncate64, 3, fd, low, high);
#ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -51,6 +54,7 @@
return result;
#ifndef __ASSUME_TRUNCATE64_SYSCALL
+ __set_errno (saved_errno);
have_no_ftruncate64 = 1;
#endif
}
============================================================
Index: sysdeps/unix/sysv/linux/truncate64.c
--- sysdeps/unix/sysv/linux/truncate64.c 1999/12/09 00:18:13 1.3
+++ sysdeps/unix/sysv/linux/truncate64.c 1999/12/18 11:01:07
@@ -43,6 +43,9 @@
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
+#ifndef __ASSUME_TRUNCATE64_SYSCALL
+ int saved_errno = errno;
+#endif
int result = INLINE_SYSCALL (truncate64, 3, path, low, high);
#ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -51,6 +54,7 @@
return result;
#ifndef __ASSUME_TRUNCATE64_SYSCALL
+ __set_errno (saved_errno);
have_no_truncate64 = 1;
#endif
}
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-12-18 3:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-18 3:05 Correct (f)truncate64 implementation Andreas Jaeger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).