Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2023 17:27:52 +0200
From:      Baptiste Daroussin <bapt@freebsd.org>
To:        Mark Johnston <markj@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: 1f31e00e19f9 - main - flua: add fbsd module
Message-ID:  <gx5xyglylgszhh4qnsutaeg7242jjelcdxy6ekd7ob6dyqucj5@dxcksbsc7mgl>
In-Reply-To: <ZRWUjMVaALGvRF9W@nuc>
References:  <202309271400.38RE0s2R037013@gitrepo.freebsd.org> <ZRWUjMVaALGvRF9W@nuc>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 28, 2023 at 10:58:20AM -0400, Mark Johnston wrote:
> On Wed, Sep 27, 2023 at 02:00:54PM +0000, Baptiste Daroussin wrote:
> > The branch main has been updated by bapt:
> > 
> > URL: https://cgit.FreeBSD.org/src/commit/?id=1f31e00e19f9e24d4c891a24973e08a027c4f71c
> > 
> > commit 1f31e00e19f9e24d4c891a24973e08a027c4f71c
> > Author:     Baptiste Daroussin <bapt@FreeBSD.org>
> > AuthorDate: 2023-09-13 07:43:33 +0000
> > Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
> > CommitDate: 2023-09-27 14:00:00 +0000
> > 
> >     flua: add fbsd module
> >     
> >     This module is bundled into flua, it only provides for now the exec
> >     function. The point of the function is to be able to execute a program
> >     without actually executing a shell.
> >     
> >     to use it:
> >     fbsd.exec({"id", "bapt"})
> 
> Hi Baptiste,
> 
> How is this different from posix.unistd.exec in the luaposix module?
> Wouldn't it be better to add this to the existing posix.unistd namespace
> in lposix.c?  exec does not seem FreeBSD-specific.

This is more like os.execure without the invocation of /bin/sh!
> 
> I have a related question: this week I wrote some FreeBSD-specific lua
> modules wrapping some system calls like sysctl(2) and cap_enter(2).  How
> do we want to organize the flua namespace for such things?  Should we
> have a freebsd.sys namespace for system call wrappers?  I would then put
> bindings for FreeBSD libraries under freebsd.* or freebsd.lib.*, so we
> could have freebsd.lib.procstat, for example.


I am fine with a module named freebsd.lib.* I plan to add kenv, rcctl,
procctl so, (I scratched sysctl and cap_enter has you have them ;) )

Bapt



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