[M3devel] Umman.off_t

Neels Janosch Hofmeyr neels at elego.de
Sat Apr 19 01:43:45 CEST 2008


Hi,

I am having problems deploying the suplib on FreeBSD (FreeBSD
new.elego.de 6.2-RELEASE-p3), using the latest cm3 snapshot
(cm3-src-all-d5.7.0-2008-04-16-14-07-05.tgz).

A type mismatch error is encountered at the last parameter of the call

        addr := Umman.mmap(NIL, StatBuf.GetStatSize(statbuf),
Umman.PROT_READ,
          Umman.MAP_SHARED, fd, 0);

, the zero, that is. The parameter is called "off" and of type off_t.

  cm3/m3-libs/m3core/src/unix/freebsd-4/Umman.i3

declares the following about off_t:


FROM Utypes IMPORT caddr_t, size_t, off_t;

<*EXTERNAL*>
PROCEDURE mmap (addr: caddr_t; len: size_t; prot,flags,fd: int; off: off_t)
  : caddr_t;


and Utypes.i3 adds:


FROM Ctypes IMPORT
        long, unsigned_long, int, unsigned_int, short, unsigned_short,
        char, unsigned_char, long_long;

TYPE
  int64_t   = long_long;

  off_t        = int64_t;


It turns out that using 0L instead of just 0 solves the compilation
error on FreeBSD.

Yes, but on linux-libc6, Utypes.i3 says something different, and the 0L
in turn causes a type mismatch there. So this is a dilemma situation
where the porting between linux and FreeBSD involves source code editing
- certainly not good.

linux-libc6/Utypes.i3:

FROM Ctypes IMPORT
        long, ...
  off_t        = long;


Any help?

Thanks!

-- 
Neels Hofmeyr -- elego Software Solutions GmbH
               Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
   http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list