unixsockets

Andrew Haines via fpc-pascal <[email protected]>
Newsgroups gmane.comp.compilers.free-pascal.general
Message-ID <[email protected]>
Hi, is unixsockets.pp in rtl-extra supposed to be included when fpc is 
built for linux? I ran

'find /usr/lib/fpc/ | grep unixsockets' and it returns nothing, also not 
in /usr/local/lib/fpc.

I needed msghdr/cmsghdr which I found in 
packages/rtl-extra/src/linux/unixsocketsh.inc.

grep -r "unixsockets" ./fpc-gitlab

./utils/dotutils/known.txt:unixsockets=*UnixApi.Sockets
./packages/rtl-extra/src/unix/unixsockets.pp:unit unixsockets;
./packages/rtl-extra/src/unix/unixsockets.pp:{$unixsocketsh.inc}
./packages/rtl-extra/src/unix/unixsockets.pp:{$unixsockets.inc}
./packages/rtl-extra/namespaced/UnixApi.Sockets.pp:{$i unixsockets.pp}
./packages/rtl-extra/namespaces.lst:src/unix/unixsockets.pp=namespaced/UnixApi.Sockets.pp

so it's not in any Makefile or fpmake.pp file.

Also, at least on my system(linux/64) the msghdr and cmshdr records have 
used socklen_t in a couple places where it should be size_t. But perhaps 
it's matching other *nix's....

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/bits/socket.h;h=ca27a3c5979c7535f33390d3fac3384710e0db9b;hb=HEAD#l265


I found this which seems to match the changes I made

https://lists.freepascal.org/fpc-pascal/2014-June/042244.html

diff --git a/packages/rtl-extra/src/linux/unixsocketsh.inc 
b/packages/rtl-extra/src/linux/unixsocketsh.inc
index 4b492654b5..27fd66449f 100644
--- a/packages/rtl-extra/src/linux/unixsocketsh.inc
+++ b/packages/rtl-extra/src/linux/unixsocketsh.inc
@@ -9,13 +9,13 @@   msghdr = record
       msg_iov : piovec;
       msg_iovlen : size_t;
       msg_control : pointer;
-     msg_controllen : socklen_t;
+     msg_controllen : size_t;
       msg_flags : cInt;
    end;

    Pcmsghdr = ^cmsghdr;
    cmsghdr = record
-    cmsg_len   : socklen_t;
+    cmsg_len   : size_t;
      cmsg_level : cInt;
      cmsg_type  : cInt;
    end;

Regards

Andrew Haines


_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.