Debian Codegraph @

conpty/conpty_other.go

raw
1 //go:build !windows
2 // +build !windows
3
4 package conpty
5
6 import (
7 "os"
8 "syscall"
9 )
10
11 // ConPty represents a Windows Console Pseudo-terminal.
12 // https://learn.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session#preparing-the-communication-channels
13 type ConPty struct{}
14
15 // New creates a new ConPty.
16 // This function is not supported on non-Windows platforms.
17 func New(int, int, int) (*ConPty, error) {
18 return nil, ErrUnsupported
19 }
20
21 // Size returns the size of the ConPty.
22 func (*ConPty) Size() (int, int, error) {
23 return 0, 0, ErrUnsupported
24 }
25
26 // Close closes the ConPty.
27 func (*ConPty) Close() error {
28 return ErrUnsupported
29 }
30
31 // Fd returns the file descriptor of the ConPty.
32 func (*ConPty) Fd() uintptr {
33 return 0
34 }
35
36 // Read implements io.Reader.
37 func (*ConPty) Read([]byte) (int, error) {
38 return 0, ErrUnsupported
39 }
40
41 // Write implements io.Writer.
42 func (*ConPty) Write([]byte) (int, error) {
43 return 0, ErrUnsupported
44 }
45
46 // Resize resizes the ConPty.
47 func (*ConPty) Resize(int, int) error {
48 return ErrUnsupported
49 }
50
51 // InPipe implements pty.
52 func (c *ConPty) InPipe() *os.File {
53 return nil
54 }
55
56 // InPipeFd implements pty.
57 func (c *ConPty) InPipeFd() uintptr {
58 return 0
59 }
60
61 // OutPipe implements pty.
62 func (c *ConPty) OutPipe() *os.File {
63 return nil
64 }
65
66 // OutPipeFd implements pty.
67 func (c *ConPty) OutPipeFd() uintptr {
68 return 0
69 }
70
71 // Spawn implements pty.
72 func (c *ConPty) Spawn(name string, args []string, attr *syscall.ProcAttr) (pid int, handle uintptr, err error) {
73 return 0, 0, ErrUnsupported
74 }