github.com/zuoyebang/bitalostable@v1.0.1-0.20240229032404-e3b99a834294/vfs/dir_unix.go (about)

     1  // Copyright 2014 The LevelDB-Go and Pebble Authors. All rights reserved. Use
     2  // of this source code is governed by a BSD-style license that can be found in
     3  // the LICENSE file.
     4  
     5  //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
     6  // +build darwin dragonfly freebsd linux netbsd openbsd solaris
     7  
     8  package vfs
     9  
    10  import (
    11  	"os"
    12  	"syscall"
    13  
    14  	"github.com/cockroachdb/errors"
    15  )
    16  
    17  func (defaultFS) OpenDir(name string) (File, error) {
    18  	f, err := os.OpenFile(name, syscall.O_CLOEXEC, 0)
    19  	return f, errors.WithStack(err)
    20  }