diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2014-02-23 19:49:19 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2014-02-23 19:49:19 +0100 |
commit | 46967f921a282bc2bbff351911ebca78af14dd4b (patch) | |
tree | 1499418561faec534b2480aad1d1c092d25cfe06 /lib/posix/linux.nim | |
parent | 6b945139e0191ad4152877ba14077b0fe3504288 (diff) | |
parent | 1f376d8594d9e20aa20b900853a166cbb49af5bf (diff) | |
download | Nim-46967f921a282bc2bbff351911ebca78af14dd4b.tar.gz |
Merge pull request #917 from zielmicha/vfork
osproc: Raise exception if execv fails in child process
Diffstat (limited to 'lib/posix/linux.nim')
-rw-r--r-- | lib/posix/linux.nim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/posix/linux.nim b/lib/posix/linux.nim new file mode 100644 index 000000000..1ed1af3b6 --- /dev/null +++ b/lib/posix/linux.nim @@ -0,0 +1,25 @@ +import posix + +const + CSIGNAL* = 0x000000FF + CLONE_VM* = 0x00000100 + CLONE_FS* = 0x00000200 + CLONE_FILES* = 0x00000400 + CLONE_SIGHAND* = 0x00000800 + CLONE_PTRACE* = 0x00002000 + CLONE_VFORK* = 0x00004000 + CLONE_PARENT* = 0x00008000 + CLONE_THREAD* = 0x00010000 + CLONE_NEWNS* = 0x00020000 + CLONE_SYSVSEM* = 0x00040000 + CLONE_SETTLS* = 0x00080000 + CLONE_PARENT_SETTID* = 0x00100000 + CLONE_CHILD_CLEARTID* = 0x00200000 + CLONE_DETACHED* = 0x00400000 + CLONE_UNTRACED* = 0x00800000 + CLONE_CHILD_SETTID* = 0x01000000 + CLONE_STOPPED* = 0x02000000 + +# fn should be of type proc (a2: pointer): void {.cdecl.} +proc clone*(fn: pointer; child_stack: pointer; flags: cint; + arg: pointer; ptid: ptr TPid; tls: pointer; ctid: ptr TPid): cint {.importc, header: "<sched.h>".} |