You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I'm trying to follow the contributor guidelines: this is my first submission. I have 20 years of coding experience, and my own github repositories at https://github.com/bolthole )
My relevant environment:
go version go1.10.1 solaris/amd64
Background: 3rd party code I want to use, calls
unix.Syscall(unix.SYS_FCNTL, ...)
Problem is, my platform of Solaris, while being a supported platform.. does not have an implementation of Syscall(). Nor can it have one, because the OS does not have that API.
Seeing as how fcntl() is in the actual POSIX standard, seems like it would be a good idea for Go to actually have an official function call for it. Particularly since practically all the platforms suported in the "unix" collection, actually have OS suport for a native fcntl() call.
I have working code, that I'd like to submit to the repo, for Solaris.
I could potentially submit an attempt at other platforms, as well, but I do not have a testbed for them.
$ go build test.go
$ truss ./test
/1: write(1, " H i t h e r e\n", 9) = 9
/1: fcntl(1, F_SETFD, 0x00000001) = 0
status of fcntl: 0
/1: write(1, " s t a t u s o f f c".., 20) = 20
/1: _exit(0)
The text was updated successfully, but these errors were encountered:
I guess I should explictly mention that my code change is extremely small; i could easly cutnpaste it here :) but for brevity at the moment, I will say that it only touches two files currently:
unix/asm_solaris_amd64.s
unix/syscall_solaris.go
I could probably trivially add in a true Fnctl() call for the other unixen platforms, by modifying just a single file,
unix/flock.go
which currently only has FcntlFlock()
bradfitz
changed the title
Proposal for code submit for x/sys/unix/Fcntl
x/sys/unix: add Solaris Fcntl?
Apr 2, 2018
(I'm trying to follow the contributor guidelines: this is my first submission. I have 20 years of coding experience, and my own github repositories at https://github.com/bolthole )
My relevant environment:
go version go1.10.1 solaris/amd64
Background: 3rd party code I want to use, calls
unix.Syscall(unix.SYS_FCNTL, ...)
Problem is, my platform of Solaris, while being a supported platform.. does not have an implementation of Syscall(). Nor can it have one, because the OS does not have that API.
Seeing as how fcntl() is in the actual POSIX standard, seems like it would be a good idea for Go to actually have an official function call for it. Particularly since practically all the platforms suported in the "unix" collection, actually have OS suport for a native fcntl() call.
I have working code, that I'd like to submit to the repo, for Solaris.
I could potentially submit an attempt at other platforms, as well, but I do not have a testbed for them.
Proof my code works:
$ cat test.go
package main
import (
"golang.org/x/sys/unix"
"fmt"
)
func main() {
var retval int
}
$ go build test.go
$ truss ./test
/1: write(1, " H i t h e r e\n", 9) = 9
/1: fcntl(1, F_SETFD, 0x00000001) = 0
status of fcntl: 0
/1: write(1, " s t a t u s o f f c".., 20) = 20
/1: _exit(0)
The text was updated successfully, but these errors were encountered: