github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/logger/redirect_stderr_linux.go (about)

     1  // Copyright 2016 Keybase, Inc. All rights reserved. Use of
     2  // this source code is governed by the included BSD license.
     3  
     4  //go:build linux && !android
     5  // +build linux,!android
     6  
     7  package logger
     8  
     9  import (
    10  	"os"
    11  	"syscall"
    12  )
    13  
    14  func tryRedirectStderrTo(f *os.File) error {
    15  	return syscall.Dup3(int(f.Fd()), 2, 0)
    16  }