Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-09

broken shmat on x86_64-linux

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Nikolay Nikolov

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)

Reply by email

Florian Klaempfl
to Nikolay Nikolov
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?

Reply by email

Nikolay Nikolov
to Florian Klaempfl
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.

Reply by email

Nikolay Nikolov
to Jonas Maebe
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.

Reply by email

Peter Vreman
to Nikolay Nikolov
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.

Reply by email