Update dependencies (#333)

This commit is contained in:
tobi 2021-11-27 15:26:58 +01:00 committed by GitHub
commit 182b4eea73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
848 changed files with 377869 additions and 107280 deletions

48
vendor/modernc.org/libc/libc_unix.go generated vendored
View file

@ -2,15 +2,17 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux || darwin || freebsd
// +build linux darwin freebsd
//go:build linux || darwin || freebsd || netbsd
// +build linux darwin freebsd netbsd
package libc // import "modernc.org/libc"
import (
"io/ioutil"
"os"
gosignal "os/signal"
"reflect"
"strings"
"syscall"
"unsafe"
@ -217,3 +219,45 @@ func Xgetresuid(t *TLS, ruid, euid, suid uintptr) int32 {
func Xgetresgid(t *TLS, rgid, egid, sgid uintptr) int32 {
panic(todo(""))
}
// FILE *tmpfile(void);
func Xtmpfile(t *TLS) uintptr {
f, err := ioutil.TempFile("", "tmpfile-")
if err != nil {
t.setErrno(err)
return 0
}
cf := newFile(t, int32(f.Fd()))
AtExit(func() {
nm := f.Name()
file(cf).close(t)
os.Remove(nm)
})
return cf
}
// FILE *fdopen(int fd, const char *mode);
func Xfdopen(t *TLS, fd int32, mode uintptr) uintptr {
m := strings.ReplaceAll(GoString(mode), "b", "")
switch m {
case
"a",
"a+",
"r",
"r+",
"w",
"w+":
default:
t.setErrno(errno.EINVAL)
return 0
}
if p := newFile(t, fd); p != 0 {
return p
}
t.setErrno(errno.EINVAL)
return 0
}