Should it support ustat syscall for arm64
Hi,
As I ran LTP testcase ustat01 and ustat02 on Arm64, and got the result:
ustat01 1 TFAIL : ustat(2) failed and setthe errno to 38 : Function not implemented
ustat02 1 TFAIL : ustat(2) failed to produce expected error; 22, errno: EINVAL:
TEST_ERRNO=ENOSYS(38): Function not implemented
ustat02 2 TFAIL : ustat(2) failed to produce expected error; 14, errno: EFAULT:
TEST_ERRNO=ENOSYS(38): Function not implemented
-----------------------
I found the glibc and kernel's implementation:
The glibc version is 2.19, kernel is 3.16.
The glibc will use the sysdeps/unix/sysv/linux/generic/ustat.c But it only return ENOSYS.
The kernel doesn't support the NR_ustat syscall.
So I did that:
1. In glibc:
I changed the sysdeps/unix/sysv/linux/generic/ustat.c:
-#include <errno.h>
-#include <sys/ustat.h>
+#define __ARCH_WANT_SYSCALL_DEPRECATED
+#include <sysdeps/unix/sysv/linux/ustat.c>
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-/* This deprecated syscall is no longer used (replaced with fstat). */ -int
-ustat (dev_t dev, struct ustat *ubuf)
-{
- __set_errno (ENOSYS);
- return -1;
-}
-stub_warning (ustat)
2. In Kernel:
I changed the arch/arm64/include/uapi/asm/unistd.h:
+#define __ARCH_WANT_SYSCALL_DEPRECATED
+#define __ARCH_WANT_SYS_FORK
+#define __ARCH_WANT_SYS_VFORK
After the changing, These cases will Pass.
So, Does it need to support ustat syscall for arm64?
Regards,
Wang
Quoted 49 lines · Wang Weidong
Hi,
As I ran LTP testcase ustat01 and ustat02 on Arm64, and got the result:
ustat01 1 TFAIL : ustat(2) failed and setthe errno to 38 : Function not implemented
ustat02 1 TFAIL : ustat(2) failed to produce expected error; 22, errno: EINVAL:
TEST_ERRNO=ENOSYS(38): Function not implemented
ustat02 2 TFAIL : ustat(2) failed to produce expected error; 14, errno: EFAULT:
TEST_ERRNO=ENOSYS(38): Function not implemented-----------------------
I found the glibc and kernel's implementation:
The glibc version is 2.19, kernel is 3.16.The glibc will use the
sysdeps/unix/sysv/linux/generic/ustat.cBut it only return ENOSYS.The kernel doesn't support the
NR_ustatsyscall.So I did that:
1. In glibc:
I changed thesysdeps/unix/sysv/linux/generic/ustat.c:(quoted diff) +2
-13-#include <errno.h> -#include <sys/ustat.h> +#define __ARCH_WANT_SYSCALL_DEPRECATED +#include <sysdeps/unix/sysv/linux/ustat.c> -#include <sysdep.h> -#include <sys/syscall.h> - -/* This deprecated syscall is no longer used (replaced with fstat). */ -int -ustat (dev_t dev, struct ustat *ubuf) -{ - __set_errno (ENOSYS); - return -1; -} -stub_warning (ustat)2. In Kernel:
I changed thearch/arm64/include/uapi/asm/unistd.h:(quoted diff) +3
-0+#define __ARCH_WANT_SYSCALL_DEPRECATED +#define __ARCH_WANT_SYS_FORK +#define __ARCH_WANT_SYS_VFORK
Quoted 1 line
After the changing, These cases will Pass.
Hi Weidong,
Quoted 1 line
So, Does it need to support ustat syscall for arm64?
No, on arm64 the ustat syscall is obsolete.
You could find syscalls from "include/uapi/asm-generic/unistd.h". And on arm64, there is no define for "__ARCH_WANT_SYSCALL_DEPRECATED". So there is no support for the syscalls covered by the macro above.
Best Regards,
Wei
Quoted 10 lines
Regards,
Wang_______________________________________________
linuxarm mailing list
linuxarm at huawei.com
http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm.
Quoted 59 lines · Wang Weidong
Quoted 3 lines
Hi,
As I ran LTP testcase ustat01 and ustat02 on Arm64, and got the
result:
Quoted 2 lines
ustat01 1 TFAIL : ustat(2) failed and setthe errno to 38 :
Function not implemented
Quoted 2 lines
ustat02 1 TFAIL : ustat(2) failed to produce expected error;
22, errno: EINVAL:
Quoted 1 line
TEST_ERRNO=ENOSYS(38): Function not
implemented
Quoted 1 line
ustat02 2 TFAIL : ustat(2) failed to produce expected error;
14, errno: EFAULT:
Quoted 38 lines
TEST_ERRNO=ENOSYS(38): Function not
implemented-----------------------
I found the glibc and kernel's implementation:
The glibc version is 2.19, kernel is 3.16.The glibc will use the
sysdeps/unix/sysv/linux/generic/ustat.cBut it only return ENOSYS.The kernel doesn't support the
NR_ustatsyscall.So I did that:
1. In glibc:
I changed thesysdeps/unix/sysv/linux/generic/ustat.c:(quoted diff) +2
-6-#include <errno.h> -#include <sys/ustat.h> +#define __ARCH_WANT_SYSCALL_DEPRECATED #include +<sysdeps/unix/sysv/linux/ustat.c> -#include <sysdep.h> -#include <sys/syscall.h> - -/* This deprecated syscall is no longer used (replaced with fstat).*/ -int -ustat (
dev_tdev, struct ustat *ubuf) -{(quoted diff) +0
-4- __set_errno (ENOSYS); - return -1; -} -stub_warning (ustat)2. In Kernel:
I changed thearch/arm64/include/uapi/asm/unistd.h:(quoted diff) +2
-0+#define __ARCH_WANT_SYSCALL_DEPRECATED #define __ARCH_WANT_SYS_FORK +#define __ARCH_WANT_SYS_VFORKQuoted 1 line
After the changing, These cases will Pass.
Hi Weidong,
Quoted 1 line
So, Does it need to support ustat syscall for arm64?
Quoted 11 lines
No, on arm64 the ustat syscall is obsolete.
You could find syscalls from "include/uapi/asm-generic/unistd.h". And on arm64, there is no define for "__ARCH_WANT_SYSCALL_DEPRECATED". So there is no support for the syscalls covered by the macro above.Best Regards,
WeiQuoted 3 lines
Regards,
Wang
Hi,
Opened an issue at https://github.com/linux-test-project/ltp/issues/25
Frediano
Quoted 67 lines · Frediano Ziglio
Quoted 67 lines · Wang Weidong
Quoted 3 lines
Hi,
As I ran LTP testcase ustat01 and ustat02 on Arm64, and got the
result:
Quoted 2 lines
ustat01 1 TFAIL : ustat(2) failed and setthe errno to 38 :
Function not implemented
Quoted 2 lines
ustat02 1 TFAIL : ustat(2) failed to produce expected error;
22, errno: EINVAL:
Quoted 1 line
TEST_ERRNO=ENOSYS(38): Function not
implemented
Quoted 1 line
ustat02 2 TFAIL : ustat(2) failed to produce expected error;
14, errno: EFAULT:
Quoted 38 lines
TEST_ERRNO=ENOSYS(38): Function not
implemented-----------------------
I found the glibc and kernel's implementation:
The glibc version is 2.19, kernel is 3.16.The glibc will use the
sysdeps/unix/sysv/linux/generic/ustat.cBut it only return ENOSYS.The kernel doesn't support the
NR_ustatsyscall.So I did that:
1. In glibc:
I changed thesysdeps/unix/sysv/linux/generic/ustat.c:(quoted diff) +2
-6-#include <errno.h> -#include <sys/ustat.h> +#define __ARCH_WANT_SYSCALL_DEPRECATED #include +<sysdeps/unix/sysv/linux/ustat.c> -#include <sysdep.h> -#include <sys/syscall.h> - -/* This deprecated syscall is no longer used (replaced with fstat).*/ -int -ustat (
dev_tdev, struct ustat *ubuf) -{(quoted diff) +0
-4- __set_errno (ENOSYS); - return -1; -} -stub_warning (ustat)2. In Kernel:
I changed thearch/arm64/include/uapi/asm/unistd.h:(quoted diff) +2
-0+#define __ARCH_WANT_SYSCALL_DEPRECATED #define __ARCH_WANT_SYS_FORK +#define __ARCH_WANT_SYS_VFORKQuoted 1 line
After the changing, These cases will Pass.
Hi Weidong,
Quoted 1 line
So, Does it need to support ustat syscall for arm64?
No, on arm64 the ustat syscall is obsolete.
You could find syscalls from "include/uapi/asm-generic/unistd.h". And on arm64, there is no define for "__ARCH_WANT_SYSCALL_DEPRECATED". So there is no support for the syscalls covered by the macro above.Best Regards,
Wei
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Regards,
WangHi,
Opened an issue at https://github.com/linux-test-project/ltp/issues/25Frediano
OK, Got it.
Thanks,
Wang
Quoted 3 lines
.