Skip to content

Commit

Permalink
Added LibTTY to provide access to ‘libtty’ (added to the VM in pharo-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinzwind committed Apr 8, 2024
1 parent 84ca491 commit 3a44480
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/UnifiedFFI/LibTTY.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"
LibTTY’s #uniqueInstance provides access to ‘libtty’, a library included with the Pharo VM that offers a function to spawn a process connected to a pseudo-terminal.
"
Class {
#name : 'LibTTY',
#superclass : 'FFILibrary',
#pools : [
'LibCTypes'
],
#category : 'UnifiedFFI-Libraries',
#package : 'UnifiedFFI',
#tag : 'Libraries'
}

{ #category : 'accessing - platform' }
LibTTY >> macLibraryName [

^ 'libtty.dylib'
]

{ #category : 'api' }
LibTTY >> ttySpawn: fdm path: path argv: argv envs: envp [

^ self ffiCall: #(pid_t tty_spawn(int fdm, const char* path, void* argv, void* envp))
]

{ #category : 'accessing - platform' }
LibTTY >> unixLibraryName [

^ 'libtty.so'
]

{ #category : 'accessing - platform' }
LibTTY >> win32LibraryName [

self shouldNotImplement
]

0 comments on commit 3a44480

Please sign in to comment.