github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/cmds/exp/console/port_linux.go (about)

     1  // Copyright 2012-2020 the u-root 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  // This file contains common variables for port IO devices for Linux
     6  package main
     7  
     8  import (
     9  	"os"
    10  )
    11  
    12  var portFile *os.File
    13  
    14  func openPort() (err error) {
    15  	portFile, err = os.OpenFile("/dev/port", os.O_RDWR, 0)
    16  	return err
    17  }