Hi Nala

Ik actually use the underlying method in C at a number of other places. And
I am uncertain that other posixen might use other numbers. So I considered
exporting it directly.

In any case, the sysconf won't work on a handful of unfortunate operating
systems.

But you are right. The less in C, the better.
Op 25 jun. 2015 05:27 schreef "Nala Ginrut" <[email protected]>:

> nice work!
> I may take look at it closely.
> And I would recommend you use FFI if you just want to get pagesize, it's
> easier than writing bunch of C code:
> =============================code========================
> (use-modules (system foreign))
> (define ffi (dynamic-link))
> (define sysconf
>   (pointer->procedure int
>                       (dynamic-func "sysconf" ffi)
>                       (list int)))
>
> (sysconf 30) ; 30 stands for _SC_PAGESIZE
> ==> 4096
> ==============================end=======================
>
> Happy hacking!
>
> On Wed, 2015-06-24 at 21:41 +0200, Sjoerd van Leent wrote:
> > Hi All,
> >
> > In line with my will to create an assembler, I started first by being
> able
> > to execute something in memory, using the memory-mapper strategy. I am
> > aware not all platforms use the same mechanism, but this is a starting
> > point.
> >
> > At a later point, an inline assembler can be used by a (more abstract)
> JIT
> > engine
> >
> > I put my repository here:
> >
> > https://github.com/santidhammo/guile-assembler
> >
> > Met vriendelijke groet,
> > Sjoerd
>
>
>

Reply via email to