Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 3,971 for flock (0.06 sec)

  1. src/syscall/syscall_illumos.go

    package syscall
    
    import "unsafe"
    
    // F_DUP2FD_CLOEXEC has different values on Solaris and Illumos.
    const F_DUP2FD_CLOEXEC = 0x24
    
    //go:cgo_import_dynamic libc_flock flock "libc.so"
    
    //go:linkname procFlock libc_flock
    
    var procFlock libcFunc
    
    func Flock(fd int, how int) error {
    	_, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procFlock)), 2, uintptr(fd), uintptr(how), 0, 0, 0, 0)
    	if errno != 0 {
    		return errno
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 15 21:07:18 UTC 2022
    - 613 bytes
    - Viewed (0)
  2. src/syscall/syscall_unix_test.go

    		}
    	} else {
    		// child
    		got := flock
    		// make sure the child lock is conflicting with the parent lock
    		got.Start--
    		got.Len++
    		if err := syscall.FcntlFlock(3, syscall.F_GETLK, &got); err != nil {
    			t.Fatalf("FcntlFlock(F_GETLK) failed: %v", err)
    		}
    		flock.Pid = int32(syscall.Getppid())
    		// Linux kernel always set Whence to 0
    		flock.Whence = 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 29 16:24:51 UTC 2022
    - 9.4K bytes
    - Viewed (0)
  3. pkg/util/flock/flock_unix.go

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package flock
    
    import "golang.org/x/sys/unix"
    
    // Acquire acquires a lock on a file for the duration of the process. This method
    // is reentrant.
    func Acquire(path string) error {
    	fd, err := unix.Open(path, unix.O_CREAT|unix.O_RDWR|unix.O_CLOEXEC, 0600)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 24 19:47:49 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  4. src/cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go

    	// returned when “the lock is blocked by a lock from another process”.
    	// If that process is blocked on some lock that we are holding, then the
    	// resulting livelock is due to a real deadlock (and would manifest as such
    	// when using, for example, the flock implementation of this package).
    	// If the other process is *not* blocked on some other lock that we are
    	// holding, then it will eventually release the requested lock.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 17 02:24:35 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  5. src/cmd/go/internal/lockedfile/internal/filelock/filelock_unix.go

    	writeLock lockType = syscall.LOCK_EX
    )
    
    func lock(f File, lt lockType) (err error) {
    	for {
    		err = syscall.Flock(int(f.Fd()), int(lt))
    		if err != syscall.EINTR {
    			break
    		}
    	}
    	if err != nil {
    		return &fs.PathError{
    			Op:   lt.String(),
    			Path: f.Name(),
    			Err:  err,
    		}
    	}
    	return nil
    }
    
    func unlock(f File) error {
    	return lock(f, syscall.LOCK_UN)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 17 02:24:35 UTC 2023
    - 723 bytes
    - Viewed (0)
  6. src/syscall/flock_aix.go

    // 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 syscall
    
    import "unsafe"
    
    // On AIX, there is no flock() system call.
    
    // FcntlFlock performs a fcntl syscall for the [F_GETLK], [F_SETLK] or [F_SETLKW] command.
    func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 570 bytes
    - Viewed (0)
  7. pkg/util/flock/flock_other.go

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package flock
    
    // Acquire is not implemented on non-unix systems.
    func Acquire(path string) error {
    	return nil
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 24 19:47:49 UTC 2021
    - 826 bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s

    //  provide the address of function variable to be fixed up.
    
    TEXT ·getPipe2Addr(SB), NOSPLIT|NOFRAME, $0-8
    	MOVD $·Pipe2(SB), R8
    	MOVD R8, ret+0(FP)
    	RET
    
    TEXT ·get_FlockAddr(SB), NOSPLIT|NOFRAME, $0-8
    	MOVD $·Flock(SB), R8
    	MOVD R8, ret+0(FP)
    	RET
    
    TEXT ·get_GetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
    	MOVD $·Getxattr(SB), R8
    	MOVD R8, ret+0(FP)
    	RET
    
    TEXT ·get_NanosleepAddr(SB), NOSPLIT|NOFRAME, $0-8
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 16:12:58 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  9. internal/lock/lock_nix.go

    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package lock
    
    import (
    	"os"
    	"syscall"
    )
    
    // Internal function implements support for both
    // blocking and non blocking lock type.
    func lockedOpenFile(path string, flag int, perm os.FileMode, lockType int) (*LockedFile, error) {
    	switch flag {
    	case syscall.O_RDONLY:
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Aug 19 01:35:22 UTC 2021
    - 2.8K bytes
    - Viewed (0)
  10. pkg/util/iptables/iptables_linux.go

    			return false, nil
    		}
    		return true, nil
    	}); err != nil {
    		return nil, fmt.Errorf("failed to acquire old iptables lock: %v", err)
    	}
    
    	success = true
    	return l, nil
    }
    
    func grabIptablesFileLock(f *os.File) error {
    	return unix.Flock(int(f.Fd()), unix.LOCK_EX|unix.LOCK_NB)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 24 19:47:49 UTC 2021
    - 2.6K bytes
    - Viewed (0)
Back to top