The 'shmat' function from the 'ipc' unit seems to be broken on x86_64-linux. This patch seems to fix it.
(Apply to rtl/linux/ipcsys.inc)
Mailing lists / fpc-devel / 2005-09
broken shmat on x86_64-linux
6 messages · 4 people · –
- NNikolay Nikolov 3
- FFlorian Klaempfl 1
- JJonas Maebe 1
- PPeter Vreman 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Nikolay Nikolov wrote 19 lines
The 'shmat' function from the 'ipc' unit seems to be broken on
x86_64-linux. This patch seems to fix it.
(Apply to rtl/linux/ipcsys.inc)
------------------------------------------------------------------------
35,36d34
< Var raddr : pointer;
< error : ptrint;
38,42c36
< error:=do_syscall(syscall_nr_SHMAT,TSysParam(shmid),TSysParam(shmflg),TSysParam(@raddr),TSysParam(shmaddr));
< If Error<0 then
< shmat:=pointer(error)
< else
< shmat:=raddr;
---
> shmat:=pointer(do_syscall(syscall_nr_SHMAT,TSysParam(shmid),TSysParam(shmaddr),TSysParam(shmflg)));
Can anybody who understand the patch, apply it ;)? Does ir work for i386 too?
Florian Klaempfl wrote 32 lines
Nikolay Nikolov wrote:
>The 'shmat' function from the 'ipc' unit seems to be broken on
>x86_64-linux. This patch seems to fix it.
>(Apply to rtl/linux/ipcsys.inc)
>
>
>------------------------------------------------------------------------
>
>35,36d34
>< Var raddr : pointer;
>< error : ptrint;
>38,42c36
>< error:=do_syscall(syscall_nr_SHMAT,TSysParam(shmid),TSysParam(shmflg),TSysParam(@raddr),TSysParam(shmaddr));
>< If Error<0 then
>< shmat:=pointer(error)
>< else
>< shmat:=raddr;
>---
>
>
>
>> shmat:=pointer(do_syscall(syscall_nr_SHMAT,TSysParam(shmid),TSysParam(shmaddr),TSysParam(shmflg)));
>>
>>
Can anybody who understand the patch, apply it ;)? Does ir work for i386
too?
the ipc unit for i386-linux includes ipccall.inc instead of ipcsys.inc, so this doesn't affect i386 at all.
Can anybody who understand the patch, apply it ;)? Does ir work for i386 too?
Florian Klaempfl wroteCan anybody who understand the patch, apply it ;)? Does ir work for i386 too?
Patch looks ok according to what I see in the man page of shmat on a x86-64 box here. It just seems error checking (via errno) is missing (but that was already the casein the original function as well).
Jonas
Jonas Maebe wrote 11 lines
On 29 sep 2005, at 22:35, Florian Klaempfl wrote:
> Can anybody who understand the patch, apply it ;)? Does ir work for
> i386
> too?
Patch looks ok according to what I see in the man page of shmat on a
x86-64 box here. It just seems error checking (via errno) is missing
(but that was already the casein the original function as well).
Error checking is done in do_syscall.
Show quoted text 15 lines
Jonas Maebe wrote:
>
> On 29 sep 2005, at 22:35, Florian Klaempfl wrote:
>
>> Can anybody who understand the patch, apply it ;)? Does ir work for
>> i386
>> too?
>
>
> Patch looks ok according to what I see in the man page of shmat on a
> x86-64 box here. It just seems error checking (via errno) is missing
> (but that was already the casein the original function as well).
Error checking is done in do_syscall.
Patch applied. But please send a unified diff next time. Use 'diff -u' or 'svn diff'. The svn diff is now the preferred option.
