Problems with lposix on win32

classic Classic list List threaded Threaded
44 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Problems with lposix on win32

D Burgess-4
yes. you can require any of the base libraries, string, os, io etc

On 1/18/06, Chris Marrin <[hidden email]> wrote:

> D Burgess wrote:
> > ...
> > Methinks Edgar had in mind that you would use
> >
> > require"osex"   or require"os.ex"
> >
> > given that you writing a C module , you can populate whicever table you
> > like, in this case os.
>
> But if you 'require "os.ex"', it will first do an implicit 'require
> "os"' and that's what I'm worried about. Will that succeed?
>
> --
> chris marrin                ,""$,
> [hidden email]          b`    $                             ,,.
>                          mP     b'                            , 1$'
>          ,.`           ,b`    ,`                              :$$'
>       ,|`             mP    ,`                                       ,mm
>     ,b"              b"   ,`            ,mm      m$$    ,m         ,`P$$
>    m$`             ,b`  .` ,mm        ,'|$P   ,|"1$`  ,b$P       ,`  :$1
>   b$`             ,$: :,`` |$$      ,`   $$` ,|` ,$$,,`"$$     .`    :$|
> b$|            _m$`,:`    :$1   ,`     ,$Pm|`    `    :$$,..;"'     |$:
> P$b,      _;b$$b$1"       |$$ ,`      ,$$"             ``'          $$
>   ```"```'"    `"`         `""`        ""`                          ,P`
> "As a general rule,don't solve puzzles that open portals to Hell"'
>
Reply | Threaded
Open this post in threaded view
|

Re: Problems with lposix on win32

Dave Dodge
In reply to this post by Chris Marrin
On Sat, Jan 14, 2006 at 09:00:59PM -0800, Chris Marrin wrote:
> Ok, I have looked at the descriptions of execvp() in win32 docs and the
> Posix spec. Win32 says it creates a "child process" while Posix says it
> "replaces the currently running process". I have trouble understanding
> this. Does the calling process exit cleanly, or just cease to exist?

In POSIX, the program that invokes execve() is just instantly thrown
away by the OS.  It does not go through any sort of application-level
shutdown.  The OS will do some internal housekeeping such as removing
memory maps that were put in place by the old process.

There's no child process; the new program takes over with the same
process ID.  Some resources from the old program will be retained for
use by the new program.  For example a file that was open in the old
program will remain open and usable by the new program, unless the old
program set the file's close-on-exec flag.

                                                  -Dave Dodge
Reply | Threaded
Open this post in threaded view
|

Re: Problems with lposix on win32

Philippe Lhoste
In reply to this post by Edgar Toernig
Edgar Toernig wrote:
> Chris Marrin wrote:
> errno is pointless.  Unlike C, Lua has multiple return values.
> And I would suggest to use strings like "ENOTEMPTY" instead of
> errno numbers.  The numbers are totally useless.

I agree. Perhaps old habits are hard to forget...

> PS: I don't like the name osex.  I'd simply put them into os.

Me too. It may be embarrassing if later somebody ask if osex is safe...
Indeed, they could go on os, or perhaps in fs as Rici points out.


I wonder, for putenv/setenv. In Linux, does this change the global
environment, or just the environment of the current process?
In WinNT, it is possible to do either. In Win9x, it is near impossible
to change global environment, unless changing AUTOEXEC.BAT and
rebooting, or using some low level trick (I know a MS exe is able to do
this).

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --
Reply | Threaded
Open this post in threaded view
|

Re: Problems with lposix on win32

Edgar Toernig
Philippe Lhoste wrote:
>
> I wonder, for putenv/setenv. In Linux, does this change the global
> environment, or just the environment of the current process?

There's no such thing as a global environment in Unix.  The environ-
ment table is, like the argument table, strictly per process.  There's
no way to change the environment of another process (well, ok, with a
debugger you can but it's difficult).

Ciao, ET.
123