aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/os
diff options
context:
space:
mode:
authorScott Feldman <[email protected]>2023-03-27 14:15:21 -0700
committerRon Evans <[email protected]>2023-12-06 13:11:44 +0100
commit4229e670ce40eea0775c89b5ca07ba7e53f1e643 (patch)
treea53d596795363f74e697a25393594684bca013f6 /src/os
parent76a7ad2a3ea27ad1571b445d753d7d7515d327b8 (diff)
downloadtinygo-4229e670ce40eea0775c89b5ca07ba7e53f1e643.tar.gz
tinygo-4229e670ce40eea0775c89b5ca07ba7e53f1e643.zip
Add network device driver model, netdev
This PR adds a network device driver model called netdev. There will be a companion PR for TinyGo drivers to update the netdev drivers and network examples. This PR covers the core "net" package. An RFC for the work is here: #tinygo-org/drivers#487. Some things have changed from the RFC, but nothing major. The "net" package is a partial port of Go's "net" package, version 1.19.3. The src/net/README file has details on what is modified from Go's "net" package. Most "net" features are working as they would in normal Go. TCP/UDP/TLS protocol support is there. As well as HTTP client and server support. Standard Go network packages such as golang.org/x/net/websockets and Paho MQTT client work as-is. Other packages are likely to work as-is. Testing results are here (https://docs.google.com/spreadsheets/d/e/2PACX-1vT0cCjBvwXf9HJf6aJV2Sw198F2ief02gmbMV0sQocKT4y4RpfKv3dh6Jyew8lQW64FouZ8GwA2yjxI/pubhtml?gid=1013173032&single=true).
Diffstat (limited to 'src/os')
-rw-r--r--src/os/file_other.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/os/file_other.go b/src/os/file_other.go
index d093e3d18..0ceee0020 100644
--- a/src/os/file_other.go
+++ b/src/os/file_other.go
@@ -42,6 +42,14 @@ func NewFile(fd uintptr, name string) *File {
return &File{&file{handle: stdioFileHandle(fd), name: name}}
}
+// Rename renames (moves) oldpath to newpath.
+// If newpath already exists and is not a directory, Rename replaces it.
+// OS-specific restrictions may apply when oldpath and newpath are in different directories.
+// If there is an error, it will be of type *LinkError.
+func Rename(oldpath, newpath string) error {
+ return ErrNotImplemented
+}
+
// Read reads up to len(b) bytes from machine.Serial.
// It returns the number of bytes read and any error encountered.
func (f stdioFileHandle) Read(b []byte) (n int, err error) {