github.com/iDigitalFlame/xmt@v0.5.4/cmd/exec_js.go (about) 1 //go:build js 2 // +build js 3 4 // Copyright (C) 2020 - 2023 iDigitalFlame 5 // 6 // This program is free software: you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation, either version 3 of the License, or 9 // any later version. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License 17 // along with this program. If not, see <https://www.gnu.org/licenses/>. 18 // 19 20 package cmd 21 22 import ( 23 "context" 24 "io" 25 "syscall" 26 27 "github.com/iDigitalFlame/xmt/cmd/filter" 28 ) 29 30 type executable struct{} 31 32 func (executable) close() {} 33 func (executable) Pid() uint32 { 34 return 0 35 } 36 func (executable) Resume() error { 37 return syscall.EINVAL 38 } 39 func (executable) Suspend() error { 40 return syscall.EINVAL 41 } 42 43 // ResumeProcess will attempt to resume the process via its PID. This will 44 // attempt to resume the process using an OS-dependent syscall. 45 // 46 // This will not affect already running processes. 47 func ResumeProcess(_ uint32) error { 48 return syscall.EINVAL 49 } 50 func (executable) Handle() uintptr { 51 return 0 52 } 53 func (executable) isStarted() bool { 54 return false 55 } 56 func (executable) isRunning() bool { 57 return false 58 } 59 60 // SuspendProcess will attempt to suspend the process via its PID. This will 61 // attempt to suspend the process using an OS-dependent syscall. 62 // 63 // This will not affect already suspended processes. 64 func SuspendProcess(_ uint32) error { 65 return syscall.EINVAL 66 } 67 func (executable) SetToken(_ uintptr) { 68 } 69 func (executable) SetFullscreen(_ bool) { 70 } 71 func (executable) SetWindowDisplay(_ int) { 72 } 73 func (executable) SetWindowTitle(_ string) { 74 } 75 func (executable) SetLogin(_, _, _ string) {} 76 func (executable) SetWindowSize(_, _ uint32) { 77 } 78 func (executable) SetUID(_ int32, _ *Process) { 79 } 80 func (executable) SetGID(_ int32, _ *Process) { 81 } 82 func (executable) SetWindowPosition(_, _ uint32) { 83 } 84 func (executable) SetChroot(_ string, _ *Process) { 85 } 86 func (executable) SetNoWindow(_ bool, _ *Process) { 87 } 88 func (executable) SetDetached(_ bool, _ *Process) { 89 } 90 func (executable) SetSuspended(_ bool, _ *Process) { 91 } 92 func (executable) kill(_ uint32, _ *Process) error { 93 return syscall.EINVAL 94 } 95 func (executable) SetNewConsole(_ bool, _ *Process) { 96 } 97 func (executable) SetParent(_ *filter.Filter, _ *Process) { 98 } 99 func (executable) StdinPipe(_ *Process) (io.WriteCloser, error) { 100 return nil, syscall.EINVAL 101 } 102 func (executable) StdoutPipe(_ *Process) (io.ReadCloser, error) { 103 return nil, syscall.EINVAL 104 } 105 func (executable) StderrPipe(_ *Process) (io.ReadCloser, error) { 106 return nil, syscall.EINVAL 107 } 108 func (executable) start(_ context.Context, _ *Process, _ bool) error { 109 return syscall.EINVAL 110 }