summaryrefslogtreecommitdiffstats
path: root/src/internal/syscall/unix/fcntl_wasip1.go
blob: e70cd74b49c780f94bd3e1f7be0ac141684e31d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build wasip1

package unix

import "syscall"

func Fcntl(fd int, cmd int, arg int) (int, error) {
	if cmd == syscall.F_GETFL {
		flags, err := fd_fdstat_get_flags(fd)
		return int(flags), err
	}
	return 0, syscall.ENOSYS
}