go fcntl_syscall_test 源码

  • 2022-07-15
  • 浏览 (849)

golang fcntl_syscall_test 代码

文件路径:/src/net/fcntl_syscall_test.go

// Copyright 2021 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 dragonfly || freebsd || linux || netbsd || openbsd

package net

import (
	"internal/syscall/unix"
	"syscall"
)

func fcntl(fd int, cmd int, arg int) (int, error) {
	r, _, e := syscall.Syscall(unix.FcntlSyscall, uintptr(fd), uintptr(cmd), uintptr(arg))
	if e != 0 {
		return int(r), syscall.Errno(e)
	}
	return int(r), nil
}

相关信息

go 源码目录

相关文章

go addrselect 源码

go addrselect_test 源码

go cgo_aix 源码

go cgo_android 源码

go cgo_bsd 源码

go cgo_linux 源码

go cgo_netbsd 源码

go cgo_openbsd 源码

go cgo_resnew 源码

go cgo_resold 源码

0  赞