[fpc-pascal]Socket() call broken in 1.9.3 CVS?

Marco van de Voort marcov at stack.nl
Sat Mar 20 16:18:53 CET 2004

> I pulled in 1.9.3 from CVS yesterday.  When I recompiled some code I have 
> been working on I found my program crashed when creating a socket.  The 
> program fails with no error.  It just exits.  I created a test program 
> with just the socket call and it also fails the same way.  Here is the 
> code:

Search and replace error probably. Update, and make sure you get

Checking in unixsock.inc;
/FPC/CVS/fpc/rtl/linux/unixsock.inc,v  <--  unixsock.inc
new revision: 1.11; previous revision: 1.10

>    Program test_socket;
>    uses
>       sockets;
>    var
>       FileHandle:  integer;
>    begin
>       writeln( 'sizeof( integer): ', sizeof( integer));
>       writeln( 'Before socket call.');
>       FileHandle:= socket( AF_INET, SOCK_DGRAM, 0);
>       writeln( 'After socket call.');
>    end.
> I followed the CVS download instructions on the Web site.  Do I need to 
> look at a different branch?

No. Just a small typo, sockets was changed last weekend, thanks for the

P.s. Michael is right btw, and it is wiser to use a  32-bit type that
doesn't depend on mode for handles like this ( cint is logical)

More information about the fpc-pascal mailing list