Commit 86ff1dba authored by Mart Lubbers's avatar Mart Lubbers

Final fix for pty, allows children to have jobcontrol

parent 564f604f
Pipeline #8202 failed with stage
in 1 minute and 16 seconds
......@@ -33,6 +33,7 @@ O_RDWR :== 02
O_NOCTTY :== 0400
TCSANOW :== 0
TIOCSCTTY :== 0x540E
//Posix API calls
errno :: !*w -> (!Int,!*w)
......@@ -58,8 +59,9 @@ unlockpt :: !Int !*w -> (!Int, !*w)
ptsname :: !Int !*w -> (!Pointer, !*w)
open :: !Pointer !Int !*w -> (!Int, !*w)
tcgetattr :: !Int !Pointer !*w -> (!Int, !*w)
cfmakeraw :: !Pointer !*w -> !*w
cfmakeraw :: !Pointer !*w -> *w
tcsetattr :: !Int !Int !Pointer !*w -> (!Int, !*w)
setsid :: !*w -> *w
dup2 :: !Int !Int !*w -> (!Int, !*w)
close :: !Int !*w -> (!Int, !*w)
ioctl :: !Int !Int !Pointer !*w -> (!Int, !*w)
......
......@@ -104,7 +104,7 @@ tcgetattr :: !Int !Pointer !*w -> (!Int, !*w)
tcgetattr fp f w = code {
ccall tcgetattr "Ip:I:A"
}
cfmakeraw :: !Pointer !*w -> !*w
cfmakeraw :: !Pointer !*w -> *w
cfmakeraw p w = code {
ccall cfmakeraw "p:V:A"
}
......@@ -112,6 +112,10 @@ tcsetattr :: !Int !Int !Pointer !*w -> (!Int, !*w)
tcsetattr fp strategy p w = code {
ccall tcsetattr "IIp:I:A"
}
setsid :: !*w -> *w
setsid w = code {
ccall setsid ":V:A"
}
dup2 :: !Int !Int !*w -> (!Int, !*w)
dup2 old new world = code {
ccall dup2 "II:I:A"
......
......@@ -32,6 +32,7 @@ O_RDWR :== 02
O_NOCTTY :== 0400
TCSANOW :== 0
TIOCSCTTY :== 0x540E
//Posix API calls
errno :: !*w -> (!Int,!*w)
......@@ -57,7 +58,8 @@ unlockpt :: !Int !*w -> (!Int, !*w)
ptsname :: !Int !*w -> (!Pointer, !*w)
open :: !Pointer !Int !*w -> (!Int, !*w)
tcgetattr :: !Int !Pointer !*w -> (!Int, !*w)
cfmakeraw :: !Pointer !*w -> !*w
cfmakeraw :: !Pointer !*w -> *w
setsid :: !*w -> *w
tcsetattr :: !Int !Int !Pointer !*w -> (!Int, !*w)
dup2 :: !Int !Int !*w -> (!Int, !*w)
close :: !Int !*w -> (!Int, !*w)
......
......@@ -104,7 +104,7 @@ tcgetattr :: !Int !Pointer !*w -> (!Int, !*w)
tcgetattr fp f w = code {
ccall tcgetattr "Ip:I:A"
}
cfmakeraw :: !Pointer !*w -> !*w
cfmakeraw :: !Pointer !*w -> *w
cfmakeraw p w = code {
ccall cfmakeraw "p:V:A"
}
......@@ -112,6 +112,10 @@ tcsetattr :: !Int !Int !Pointer !*w -> (!Int, !*w)
tcsetattr fp strategy p = code {
ccall tcsetattr "IIp:I:A"
}
setsid :: !*w -> *w
setsid w = code {
ccall setsid ":V:A"
}
dup2 :: !Int !Int !*w -> (!Int, !*w)
dup2 old new world = code {
ccall dup2 "II:I:A"
......
......@@ -127,6 +127,12 @@ where
| res == -1 = getLastOSError world
# (res, world) = dup2 slavePty STDERR_FILENO world
| res == -1 = getLastOSError world
//Set the correct ioctl settings
# world = setsid world
# (res, world) = ioctl 0 TIOCSCTTY 1 world
| res == -1 = getLastOSError world
//Start
# (_, world) = runProcessChildProcessExec path args mCurrentDirectory pipeExecErrorOut pipeExecErrorIn world
// this is never executed as 'childProcessExec' never returns
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment