Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2024 16:43:31 -0700
From:      Jacques Fourie <jacques.fourie@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Cy Schubert <Cy.Schubert@cschubert.com>, Jan Knepper <jan@digitaldaemon.com>,  Mark Delany <x9k@charlie.emu.st>, freebsd-hackers@freebsd.org
Subject:   Re: Rust: kernel vs user-space
Message-ID:  <CALX0vxCq0hVocahyoe_wk7NG2nF55T2ue7enUR33sPZHtKnqUw@mail.gmail.com>
In-Reply-To: <Ztjh773c6Rwo6BTQ@kib.kiev.ua>
References:  <0.2.0-final-1725440949.866-0xb4bb20@qmda.emu.st> <78BC157F-6E30-49C4-931D-9EB539BD0322@digitaldaemon.com> <20240904221522.63E0366@slippy.cwsent.com> <Ztjh773c6Rwo6BTQ@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Wed, Sep 4, 2024 at 3:41 PM Konstantin Belousov <kostikbel@gmail.com>
wrote:

> On Wed, Sep 04, 2024 at 03:15:22PM -0700, Cy Schubert wrote:
> > In message <78BC157F-6E30-49C4-931D-9EB539BD0322@digitaldaemon.com>,
> Jan
> > Kneppe
> > r writes:
> > > D
> > >
> > > www.dlang.org
> >
> > The problem with D is data structure definitions need to also be
> mirrored
> > (duplicated) in D. For example, when 64-bit inodes were implemented D
> > failed to build and generate any code. The reason for this was
> > ufs/ufs/inode.h now defined 64-bit inodes while the D representation as
> > provided by the D language were still 32-bit. I had opened an issue with
> > upstream regarding this. To this day they still haven't figured out how
> to
> > implement 64-bit inodes on newer FreeBSD systems while maintaining
> 32-bit
> > inode backward compatibility on older FreeBSD systems (as FreeBSD
> > implemented this using ifunc).
>
> Rust is same.  It still uses pre-ino64 bindings for both stdlib and libc.
>

Looking at the Rust libc bindings I see the following:
https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs#L8
https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs#L5

Seems to have changed to 64 bit for FreeBSD 12 and up?

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2024 at 3:41 PM Konstantin Belousov &lt;<a href="mailto:kostikbel@gmail.com">kostikbel@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Wed, Sep 04, 2024 at 03:15:22PM -0700, Cy Schubert wrote:<br>
&gt; In message &lt;<a href="mailto:78BC157F-6E30-49C4-931D-9EB539BD0322@digitaldaemon.com" target="_blank">78BC157F-6E30-49C4-931D-9EB539BD0322@digitaldaemon.com</a>&gt;, Jan <br>
&gt; Kneppe<br>
&gt; r writes:<br>
&gt; &gt; D<br>
&gt; &gt;<br>
&gt; &gt; <a href="http://www.dlang.org" rel="noreferrer" target="_blank">www.dlang.org</a><br>
&gt; <br>
&gt; The problem with D is data structure definitions need to also be mirrored <br>
&gt; (duplicated) in D. For example, when 64-bit inodes were implemented D <br>
&gt; failed to build and generate any code. The reason for this was <br>
&gt; ufs/ufs/inode.h now defined 64-bit inodes while the D representation as <br>
&gt; provided by the D language were still 32-bit. I had opened an issue with <br>
&gt; upstream regarding this. To this day they still haven&#39;t figured out how to <br>
&gt; implement 64-bit inodes on newer FreeBSD systems while maintaining 32-bit <br>
&gt; inode backward compatibility on older FreeBSD systems (as FreeBSD <br>
&gt; implemented this using ifunc).<br>
<br>
Rust is same.  It still uses pre-ino64 bindings for both stdlib and libc.<br></blockquote><div><br></div><div>Looking at the Rust libc bindings I see the following:</div><div><a href="https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs#L8">https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs#L8</a></div><div><a href="https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs#L5">https://github.com/rust-lang/libc/blob/72c40004a3568849055c0bab5c92c9975b4eb132/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs#L5</a></div><div><br></div><div>Seems to have changed to 64 bit for FreeBSD 12 and up? <br></div></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALX0vxCq0hVocahyoe_wk7NG2nF55T2ue7enUR33sPZHtKnqUw>