[squeak-dev] Re: [Pharo-dev] Can I access symbolic constants from NB
FFI?
Eliot Miranda
eliot.miranda at gmail.com
Wed Dec 23 22:45:06 UTC 2015
Hi Mariano,
> On Dec 22, 2015, at 8:36 PM, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
>
>
>
>> On Tue, Dec 22, 2015 at 5:24 PM, tesonep at gmail.com <tesonep at gmail.com> wrote:
>> Hello Mariano,
>> WNOHANG is a constant is defined in sys/wait.h, after the compilation is not included in the object file.
>>
>> You will have to duplicate its value in the Smalltalk Code. It's value is 1, in linux is defined in bits/waitflags.h as
>>
>> #define WNOHANG 1
>
> mmmmmm but then I would need to take care about its different values in different OS right?
> I am reading for example this thread: https://groups.google.com/forum/#!topic/comp.lang.python/_5rCpfYR_ZE
>
> sunos 4.1.3 : #define WNOHANG 1
> Solaris 2.4 : #define WNOHANG 0100
> OSF1 2.0 : #define WNOHANG 0x1
> Ultrix 4.4 : #define WNOHANG 1
> irix 4.0.5C : #define WNOHANG 0x1
> irix 5.2 : #define WNOHANG 0100
> irix 6.0.1 : #define WNOHANG 0100
>
Exactly. I've discussed this before. Please read
http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/2012-May/064382.html
> OK..the thread is from 1995... I thought the POSIX standard would standardize that...
>
> I am now checking at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/wait.h
>
> and it says:
> #define WNOHANG 0x00000001
>
> But again..I wonder how portable is to stick to that...
>
> Ok...maybe I will need to go with a VM primitive as #primGetChildExitStatus: that way I can do the:
>
> self cCode: 'waitpid ( pidToHandle, &exitStatus, WNOHANG )' inSmalltalk: [ exitStatus := -1 ].
>
>
> pd: que groso Pablito verte por aca!!!!
>
>> Cheers,
>> Pablo
>>
>>> On Tue, Dec 22, 2015 at 5:12 PM, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
>>> Hi guys,
>>>
>>> Say I want to call to waitpid like this:
>>>
>>> waitpid(childID, &status, WNOHANG);
>>>
>>> How can I do since I don't have access to WNOHANG int value in order to send it via argument .... ???
>>>
>>> Any idea?
>>>
>>> Thanks in advance,
>>>
>>> Mariano
>>> http://marianopeck.wordpress.com
>>
>> Pablo Tesone.
>> tesonep at gmail.com
>
> Mariano
> http://marianopeck.wordpress.com
_,,,^..^,,,_ (phone)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20151223/0183f8db/attachment.htm
More information about the Squeak-dev
mailing list
|