Copyright 2018 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.

package poll

import (
	
	_  // for go:linkname
)
OpenDir returns a pointer to a DIR structure suitable for ReadDir. In case of an error, the name of the failed syscall is returned along with a syscall.Errno.
fdopendir(3) takes control of the file descriptor, so use a dup.
	, ,  := .Dup()
	if  != nil {
		return 0, , 
	}
	var  uintptr
	for {
		,  = fdopendir()
		if  != syscall.EINTR {
			break
		}
	}
	if  != nil {
		syscall.Close()
		return 0, "fdopendir", 
	}
	return , "", nil
}
Implemented in syscall/syscall_darwin.go.go:linkname fdopendir syscall.fdopendir