* [PATCH] Fix compat stat handling on sparc64
@ 2005-04-05 20:57 David S. Miller
2005-04-05 23:52 ` Stephen Rothwell
0 siblings, 1 reply; 2+ messages in thread
From: David S. Miller @ 2005-04-05 20:57 UTC (permalink / raw)
To: linux-kernel; +Cc: sparclinux
The compat layer on sparc64 was not filling in the nanosecond
fields in properly for 32-bit compat tasks. This caused things
like the test-utime.c test to fail in the libc sources.
A problem still remains for native 64-bit binaries. Like Alpha
the normal stat structure doesn't have the nanosecond fields
so I have to add in the stat64 syscall entry points in the 64-bit
syscall table then add the necessary libc magic.
Signed-off-by: David S. Miller <davem@davemloft.net>
===== arch/sparc64/kernel/sys_sparc32.c 1.118 vs edited =====
--- 1.118/arch/sparc64/kernel/sys_sparc32.c 2005-03-21 09:56:06 -08:00
+++ edited/arch/sparc64/kernel/sys_sparc32.c 2005-04-05 12:38:54 -07:00
@@ -352,11 +352,11 @@
err |= put_user(old_encode_dev(stat->rdev), &statbuf->st_rdev);
err |= put_user(stat->size, &statbuf->st_size);
err |= put_user(stat->atime.tv_sec, &statbuf->st_atime);
- err |= put_user(0, &statbuf->__unused1);
+ err |= put_user(stat->atime.tv_nsec, &statbuf->st_atime_nsec);
err |= put_user(stat->mtime.tv_sec, &statbuf->st_mtime);
- err |= put_user(0, &statbuf->__unused2);
+ err |= put_user(stat->mtime.tv_nsec, &statbuf->st_mtime_nsec);
err |= put_user(stat->ctime.tv_sec, &statbuf->st_ctime);
- err |= put_user(0, &statbuf->__unused3);
+ err |= put_user(stat->ctime.tv_nsec, &statbuf->st_ctime_nsec);
err |= put_user(stat->blksize, &statbuf->st_blksize);
err |= put_user(stat->blocks, &statbuf->st_blocks);
err |= put_user(0, &statbuf->__unused4[0]);
===== include/asm-sparc64/compat.h 1.19 vs edited =====
--- 1.19/include/asm-sparc64/compat.h 2005-02-17 21:53:03 -08:00
+++ edited/include/asm-sparc64/compat.h 2005-04-05 12:37:58 -07:00
@@ -51,11 +51,11 @@
compat_dev_t st_rdev;
compat_off_t st_size;
compat_time_t st_atime;
- u32 __unused1;
+ u32 st_atime_nsec;
compat_time_t st_mtime;
- u32 __unused2;
+ u32 st_mtime_nsec;
compat_time_t st_ctime;
- u32 __unused3;
+ u32 st_ctime_nsec;
compat_off_t st_blksize;
compat_off_t st_blocks;
u32 __unused4[2];
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix compat stat handling on sparc64
2005-04-05 20:57 [PATCH] Fix compat stat handling on sparc64 David S. Miller
@ 2005-04-05 23:52 ` Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2005-04-05 23:52 UTC (permalink / raw)
To: David S. Miller; +Cc: linux-kernel, sparclinux
[-- Attachment #1: Type: text/plain, Size: 561 bytes --]
Hi Dave,
On Tue, 5 Apr 2005 13:57:37 -0700 "David S. Miller" <davem@davemloft.net> wrote:
>
> --- 1.19/include/asm-sparc64/compat.h 2005-02-17 21:53:03 -08:00
> +++ edited/include/asm-sparc64/compat.h 2005-04-05 12:37:58 -07:00
> @@ -51,11 +51,11 @@
> compat_dev_t st_rdev;
> compat_off_t st_size;
> compat_time_t st_atime;
> - u32 __unused1;
> + u32 st_atime_nsec;
Surely you meant to put compat_ulong_t instead of u32 ... :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-04-05 23:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-05 20:57 [PATCH] Fix compat stat handling on sparc64 David S. Miller
2005-04-05 23:52 ` Stephen Rothwell
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 NNTP newsgroup(s).