public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/28883] New: sysdeps/unix/sysv/linux/select.c: __select64 !__ASSUME_TIME64_SYSCALLS && !__ASSUME_PSELECT fails on Microblaze
@ 2022-02-12 1:18 mark.hatle at kernel dot crashing.org
2022-02-16 14:07 ` [Bug libc/28883] " adhemerval.zanella at linaro dot org
2022-02-16 19:46 ` adhemerval.zanella at linaro dot org
0 siblings, 2 replies; 3+ messages in thread
From: mark.hatle at kernel dot crashing.org @ 2022-02-12 1:18 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28883
Bug ID: 28883
Summary: sysdeps/unix/sysv/linux/select.c: __select64
!__ASSUME_TIME64_SYSCALLS && !__ASSUME_PSELECT fails
on Microblaze
Product: glibc
Version: 2.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: mark.hatle at kernel dot crashing.org
CC: drepper.fsp at gmail dot com
Target Milestone: ---
Created attachment 13975
--> https://sourceware.org/bugzilla/attachment.cgi?id=13975&action=edit
Proposed fix for the issue.
If the minimum kernel version is configured to be less then 3.15,
__ASSUME_PSELECT is NOT enabled. This results in the __select64 eventually
calling:
int r = SYSCALL_CANCEL (select, nfds, readfds, writefds, exceptfds, ptv32);
The select syscall is NOT implement on Microblaze. In the past, prior to
commit 4c3df0eba5e8fe98f0de917ade9b2ebba6951c5f, there was code that would
check if 'newselect' was defined and would change 'select' to 'newselect'.
https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps/unix/sysv/linux/select.c;h=da25b4b4cfee143b8d10a51be4fdf31f6489f270;hp=dc16a816ed9e5f9bb2d28a15020be4a9917122c1;hb=4c3df0eba5e8fe98f0de917ade9b2ebba6951c5f;hpb=91cf411ad3ef10bd18ec053854fcb919be4f6789
Specifically the code that was removed was:
# ifndef __ASSUME_PSELECT
# ifdef __NR__newselect
# undef __NR_select
# define __NR_select __NR__newselect
# endif
With this code removed, the syscall returns from the kernel with errno of
ENOSYS. Restoring the above everything works properly.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libc/28883] sysdeps/unix/sysv/linux/select.c: __select64 !__ASSUME_TIME64_SYSCALLS && !__ASSUME_PSELECT fails on Microblaze
2022-02-12 1:18 [Bug libc/28883] New: sysdeps/unix/sysv/linux/select.c: __select64 !__ASSUME_TIME64_SYSCALLS && !__ASSUME_PSELECT fails on Microblaze mark.hatle at kernel dot crashing.org
@ 2022-02-16 14:07 ` adhemerval.zanella at linaro dot org
2022-02-16 19:46 ` adhemerval.zanella at linaro dot org
1 sibling, 0 replies; 3+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2022-02-16 14:07 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28883
Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |adhemerval.zanella at linaro dot o
| |rg
--- Comment #1 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
It would be good if Linux UAPI could clean this up and advertise the real
supported syscall, so consumers would not require to add such hacks. I will
push a slight different patch (below), it documents microblaze difference and
gives glibc a consistent view of the supported syscalls.
PS: next time please send the patch to libc-alpha maillist, we don't apply
patch that were only attached in the bugzilla.
---
diff --git a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
index 6e10c3661d..06c0575325 100644
--- a/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/microblaze/arch-syscall.h
@@ -313,7 +313,7 @@
#define __NR_sched_setscheduler 156
#define __NR_sched_yield 158
#define __NR_seccomp 384
-#define __NR_select 82
+#define __NR_select 142
#define __NR_semctl 328
#define __NR_semget 329
#define __NR_semop 330
diff --git a/sysdeps/unix/sysv/linux/microblaze/fixup-asm-unistd.h
b/sysdeps/unix/sysv/linux/microblaze/fixup-asm-unistd.h
new file mode 100644
index 0000000000..6103a5c13e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/microblaze/fixup-asm-unistd.h
@@ -0,0 +1,23 @@
+/* Regularize <asm/unistd.h> definitions. Microblaze version.
+ Copyright (C) 2022 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Microblaze does not implement __NR_select, besides kernel advertise
+ it. */
+#ifdef __NR_select
+# undef __NR_select
+# define __NR_select __NR__newselect
+#endif
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libc/28883] sysdeps/unix/sysv/linux/select.c: __select64 !__ASSUME_TIME64_SYSCALLS && !__ASSUME_PSELECT fails on Microblaze
2022-02-12 1:18 [Bug libc/28883] New: sysdeps/unix/sysv/linux/select.c: __select64 !__ASSUME_TIME64_SYSCALLS && !__ASSUME_PSELECT fails on Microblaze mark.hatle at kernel dot crashing.org
2022-02-16 14:07 ` [Bug libc/28883] " adhemerval.zanella at linaro dot org
@ 2022-02-16 19:46 ` adhemerval.zanella at linaro dot org
1 sibling, 0 replies; 3+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2022-02-16 19:46 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=28883
Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
Target Milestone|--- |2.36
Assignee|unassigned at sourceware dot org |adhemerval.zanella at linaro dot o
| |rg
--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
Fixed on 2.36.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-16 19:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-12 1:18 [Bug libc/28883] New: sysdeps/unix/sysv/linux/select.c: __select64 !__ASSUME_TIME64_SYSCALLS && !__ASSUME_PSELECT fails on Microblaze mark.hatle at kernel dot crashing.org
2022-02-16 14:07 ` [Bug libc/28883] " adhemerval.zanella at linaro dot org
2022-02-16 19:46 ` adhemerval.zanella at linaro dot org
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).