lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


To answer though, CLOCK_MONOTONIC and friends are simply not implemented in OSX, if you need monotonic time you have to use something like mach_absolute_time() from <mach/mach_time.h>.

It should be easy enough to change the if's to something that will throw an error if you hit an unsupported clock type for the given platform.

On Fri, Dec 10, 2010 at 5:54 AM, Hisham <hisham.hm@gmail.com> wrote:
On Thu, Dec 9, 2010 at 4:46 PM, Rob Hoelz <rob@hoelz.ro> wrote:
> lhf wrote luaposix (also known as lposix).  It's listed as no longer
> maintained, though.
>
> http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/

This is the home of luaposix, the successor to lhf's lposix:

http://git.alpinelinux.org/cgit/luaposix

There is a tendency to have naming confusion in Lua modules, with some
modules being called by various names (foo, luafoo, lfoo). I've been
meaning to write about this project for a while. Even in the LuaRocks
repository we haven't been entirely consistent about this -- at least
within LuaRocks each rock is referred to by a single name, but some
rock names have lprefixes and some don't, and similar variety happens
in module names.

-- Hisham

> On Thu, 9 Dec 2010 10:35:01 -0800
> Zed Shaw <zed.shaw@gmail.com> wrote:
>
>> Hi,
>>
>> I couldn't find contact information for any of the authors of
>> luaposix, so I figured I'd report it here and see if people have a
>> solution.  In Tir I use luaposix, but folks on OSX have this build
>> failure:
>>
>> sudo luarocks install luaposix
>> Installing
>> http://luarocks.org/repositories/rocks/luaposix-5.1.7-2.src.rock
>> Archive:  /private/tmp/luarocks_luarocks-rock-luaposix-5.1.7-2-8760/luaposix-5.1.7-2.src.rock
>> inflating: luaposix-5.1.7-2.rockspec inflating: luaposix-5.1.7.tar.bz2
>> export MACOSX_DEPLOYMENT_TARGET=10.3; gcc -O2 -I/usr/local/include -c
>> lposix.c -o lposix.o
>> lposix.c: In function ‘get_clk_id_const’:
>> lposix.c:1214: error: ‘CLOCK_REALTIME’ undeclared (first use in this
>> function) lposix.c:1214: error: (Each undeclared identifier is
>> reported only once lposix.c:1214: error: for each function it appears
>> in.) lposix.c:1216: error: ‘CLOCK_MONOTONIC’ undeclared (first use in
>> this function) lposix.c:1218: error: ‘CLOCK_PROCESS_CPUTIME_ID’
>> undeclared (first use in this function)
>> lposix.c:1220: error: ‘CLOCK_THREAD_CPUTIME_ID’ undeclared (first use
>> in this function)
>>
>> Error: Build error: Failed compiling object lposix.o
>>
>> This isn't a problem in luaposix 5.1.2, so I'm rolling back the
>> dependency to then.
>>
>> Zed
>>
>
>