Moved generated code into a separate file
This commit is contained in:
@@ -258,6 +258,8 @@ func setTermSettingsStopBits(bits StopBits, settings *syscall.Termios) error {
|
||||
|
||||
// native syscall wrapper functions
|
||||
|
||||
//sys ioctl(fd int, req uint64, data uintptr) (err error)
|
||||
|
||||
func (port *linuxSerialPort) acquireExclusiveAccess() error {
|
||||
return ioctl(port.handle, syscall.TIOCEXCL, 0)
|
||||
}
|
||||
@@ -276,13 +278,4 @@ func (port *linuxSerialPort) setTermSettings(settings *syscall.Termios) error {
|
||||
return ioctl(port.handle, syscall.TCSETS, uintptr(unsafe.Pointer(settings)))
|
||||
}
|
||||
|
||||
//sys ioctl(fd int, req uint64, data uintptr) (err error)
|
||||
func ioctl(fd int, req uint64, data uintptr) (err error) {
|
||||
_, _, e1 := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(data))
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// vi:ts=2
|
||||
|
||||
Reference in New Issue
Block a user