github.com/searKing/golang/go@v1.2.117/sync/filelock/filelock_other.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !unix && !windows
     6  
     7  // Copied from go/gc/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go
     8  
     9  package filelock
    10  
    11  import (
    12  	"errors"
    13  	"io/fs"
    14  )
    15  
    16  type lockType int8
    17  
    18  const (
    19  	readLock = iota + 1
    20  	writeLock
    21  )
    22  
    23  func lock(f File, lt lockType, try bool) error {
    24  	return &fs.PathError{
    25  		Op:   lt.String(),
    26  		Path: f.Name(),
    27  		Err:  errors.ErrUnsupported,
    28  	}
    29  }
    30  
    31  func unlock(f File) error {
    32  	return &fs.PathError{
    33  		Op:   "Unlock",
    34  		Path: f.Name(),
    35  		Err:  errors.ErrUnsupported,
    36  	}
    37  }