On Tue, Dec 22, 2015 at 5:50 PM, tesonep@gmail.com <tesonep@gmail.com> wrote:
Hi Mariano, it is supossed to be Posix, but Posix.1, it's another revision.
Since Solaris 10, it is supposed to supports all extensions of Posix ( http://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html) and Irix 6 (is discontinued, and is not Posix.1 compatible)
Also I can say that the GHC (Haskell) implementation assumes the value 1 for the constant, you can check the source code in:
https://hackage.haskell.org/package/posix-waitpid-0.1/docs/src/System-Posix-...
I think is enough safe to have the 1 as a constant, if not you will have to generate a plugin for every platform.
Thanks Pablito. I assumed 1 for now and in fact it did work for OSX at least :)
The other alternative is to read the constant value from the C Header, but is maybe an overkill.
Yes, I thought the same...but I would need the sources...
Chers,
Pd: hace rato que estoy por aca, pero me cuesta responder, a veces va muy rapido y otras vuelan muy alto :).
jajajajaj groso
On Tue, Dec 22, 2015 at 5:36 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
On Tue, Dec 22, 2015 at 5:24 PM, tesonep@gmail.com <tesonep@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
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@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@gmail.com
-- Mariano http://marianopeck.wordpress.com
-- Pablo Tesone. tesonep@gmail.com
-- Mariano http://marianopeck.wordpress.com