lposix portability

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

lposix portability

Luiz Henrique de Figueiredo
A new version of my POSIX library is almost ready. I still have to write
a reasonable test and perhaps some documentation, and so I'm not ready yet
to release a tarball. However, since there are a few flavors of POSIX
around, I thought I'd ask anyone interested to try to compile this code
on their system and report any problems.

The code has been simplified and extended. The API has changed a bit.
A summary is below. I'd like to hear your impressions on what is missing
or useless. (Some candidates for removal are pathconf and sysconf.)

The code seems to compile ok under Lua 5.0 (but pipe does not work yet
in Lua 5.0).

Thanks for your feedback.
--lhf

posix library:
 access(path,[mode]) kill(pid,[sig])
 basename(path) link(old,new,[symbolic])
 chdir(path) mkdir(path)
 chmod(path,mode) mkfifo(path)
 chown(path,uid,gid) pathconf([path,options])
 ctermid() pipe()
 dirname(path) readlink(path)
 dir([path]) setenv(name,value,[over])
 dup(old,[new]) setpid(option,...)
 errno([n]) sleep(seconds)
 exec(path,[args]) stat(path,[options])
 files([path]) sysconf([options])
 fork() times([options])
 getcwd() ttyname([fd])
 getenv([name]) umask([mode])
 getgroup(name|id) uname([string])
 getlogin() utime(path,[mtime,atime])
 getpasswd(name|id,[sel]) version
 getpid([options]) wait([pid])
 hostid()


lposix.c (21K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: lposix portability

Chris Larson
On 4/7/06, Luiz Henrique de Figueiredo <[hidden email]> wrote:
> A new version of my POSIX library is almost ready. I still have to write
> a reasonable test and perhaps some documentation, and so I'm not ready yet
> to release a tarball. However, since there are a few flavors of POSIX
> around, I thought I'd ask anyone interested to try to compile this code
> on their system and report any problems.

Greetings Luiz,

     I was curious as to whether anyone has taken on adding some of
the POSIX real time extensions to lposix, such as clock_gettime, which
would be useful, on systems that support it, to obtain the cpu time
rather than the system time for profiling.
--
Chris Larson - kergoth at handhelds dot org
Software Engineer - Computer Sciences Corporation - clarson2 at csc dot com
Core Developer/Architect - TSLib, BitBake, OpenEmbedded, OpenZaurus
Reply | Threaded
Open this post in threaded view
|

Re: lposix portability

Reuben Thomas-5
In reply to this post by Luiz Henrique de Figueiredo
Luiz wrote:

> A new version of my POSIX library is almost ready.

A couple of things. I dropped lposix.c into the previous distribution.
The only problem is that it makes lposix.so, but the open function is
called _posix, so it doesn't automatically work.

Also, how about some options, e.g. a minimal Windows (e.g. MinGW) build?

--
http://rrt.sc3d.org/ | impeccable, a.  not liable to detection (Bierce)
Reply | Threaded
Open this post in threaded view
|

Re: lposix portability

Luiz Henrique de Figueiredo
> I dropped lposix.c into the previous distribution.

I'm sorry I did not provide a Makefile. To try the version I posted,
just add luaopen_posix to linit.c.

> Also, how about some options, e.g. a minimal Windows (e.g. MinGW) build?

To do that, I'd need to know exactly what works on which platform.
Hence my plea for testing the code.

Thanks.
--lhf
Reply | Threaded
Open this post in threaded view
|

Re: lposix portability

D Burgess-4
In reply to this post by Luiz Henrique de Figueiredo
Why not posix_spawn()?
Reply | Threaded
Open this post in threaded view
|

Re: lposix portability

Luiz Henrique de Figueiredo
> Why not posix_spawn()?

Because there is fork+exec. Also, posix_spawn is a POSIX extension.