[fpc-pascal] fpsocket error

Henry Vermaak henry.vermaak at gmail.com
Wed Aug 19 13:29:44 CEST 2009


2009/8/19 Henry Vermaak <henry.vermaak at gmail.com>:
> 2009/8/19 Евгений <sem-evgen at rambler.ru>:
>> Thank you for your advice, I tried. A simple socket program written in C
>> works. Now I don't know what to do with Pascal, i don't want to rewrite my
>> large program in C.
>
> Try using strace to get more information.

If you are using an EABI kernel, it will be the socketcall syscall
that's failing.  This is the code in unistd.h:

/*
 * The following syscalls are obsolete and no longer available for EABI.
 */
#if defined(__ARM_EABI__) && !defined(__KERNEL__)
#undef __NR_time
#undef __NR_umount
#undef __NR_stime
#undef __NR_alarm
#undef __NR_utime
#undef __NR_getrlimit
#undef __NR_select
#undef __NR_readdir
#undef __NR_mmap
#undef __NR_socketcall
#undef __NR_syscall
#undef __NR_ipc
#endif

The fpc socket implementation tries to use socketcall for arm eabi, so
you can try the following patch and recompile fpc (not tested):

Index: rtl/linux/unixsock.inc
===================================================================
--- rtl/linux/unixsock.inc	(revision 13557)
+++ rtl/linux/unixsock.inc	(working copy)
@@ -13,7 +13,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 }

-{$ifndef cpux86_64}
+{$if not defined(cpux86_64) and not defined(FPC_ABI_EABI)}
   {$define NEED_SOCKETCALL}
 {$endif}

Henry



More information about the fpc-pascal mailing list