On 2012/04/23 03:18:37, fsouza wrote:
> Ping?
I'm not sure what the policy is currently on adding new exported symbols to
pkg/syscall. What were you planning on doing with these ?
FWIW, these are relatively straightforward to do directly in terminal packages.
I'd only put them in the stdlib if they were used in the stdlib or were
relatively easy to use directly (which I'd argue is not the case here).
https://github.com/kylelemons/goat/blob/go.r60/term/termio.go
On 2012/04/23 20:19:35, kevlar wrote:
> FWIW, these are relatively straightforward to do directly in terminal
packages.
> I'd only put them in the stdlib if they were used in the stdlib or were
> relatively easy to use directly (which I'd argue is not the case here).
>
> https://github.com/kylelemons/goat/blob/go.r60/term/termio.go
I agree, but what happens to termios support on linux? It is in the stdlib
Op 23 april 2012 04:56 heeft <dave@cheney.net> het volgende geschreven:
> On 2012/04/23 03:18:37, fsouza wrote:
>>
>> Ping?
>
>
> I'm not sure what the policy is currently on adding new exported symbols
> to pkg/syscall. What were you planning on doing with these ?
There are only two marginally reasonable reasons I think package
syscall is incomplete:
1) The tendency of Go to encourage portable programs
2) We only pulled in the ones we needed for OS-specific code in the
runtime and standard library
Many syscalls aren't frequently used and because of #2, it was more of
a time waste to attempt to implement them all than it was worth.
I don't think that syscall being an incomplete package because we
didn't need all of them for the standard library is a good argument.
It's a pain that there's a non-portable syscall interface (that's made
even more non-portable by using the sub-interface of ioctls) that has
marginally similar implementations across at least 3 operating systems
we have first tier support for, and I can understand the consistency
argument. Termios is defined for Linux.
I don't think we should be against adding things to package syscall
just because people can write non-portable programs with them. The
syscall package docs even admit this a bit with "Use [the standard
library] packages rather than this one *if you can.*" (emphasis mine).
Anybody needing to use syscalls is likely to understand these
implications and be ok with that. If Go doesn't wish to let people use
syscalls, then syscall.RawSyscall shouldn't be exported. Otherwise, I
don't see any reason to deny a CL making a systems interface easier to
use for a tier 1 target, especially if someone already provided the
code.
From a code perspective, LGTM.
--dho
See the note at the top of the z* files. http://codereview.appspot.com/6063053/diff/5001/src/pkg/syscall/zerrors_darwin_386.go File src/pkg/syscall/zerrors_darwin_386.go (left): http://codereview.appspot.com/6063053/diff/5001/src/pkg/syscall/zerrors_darwin_386.go#oldcode149 ...
On 2012/04/25 01:42:22, rsc wrote:
> See the note at the top of the z* files.
>
>
http://codereview.appspot.com/6063053/diff/5001/src/pkg/syscall/zerrors_darwi...
> File src/pkg/syscall/zerrors_darwin_386.go (left):
>
>
http://codereview.appspot.com/6063053/diff/5001/src/pkg/syscall/zerrors_darwi...
> src/pkg/syscall/zerrors_darwin_386.go:149: ECHO =
> 0x8
> Why did this change? These are auto-generated files but I don't see anything
> changing in the generators. Also, usually we handle constants by adding them
> here (via changes in the generators) not by explicit enumeration in
> types_darwin.go.
ouch, sorry about that. Actually, I did not use the go generator (I didn't read
the file headers, sorry again about that) and ended up creating some script to
generate these constants.
I'll take a look in the generators and get back here.
Please take another look.
I've changed mkerrors.sh to include termios.h constants in go files, and
regenerates zerrors_darwin_* using mkall.sh.
https://codereview.appspot.com/6063053/diff/5001/src/pkg/syscall/zerrors_darw...
File src/pkg/syscall/zerrors_darwin_386.go (left):
https://codereview.appspot.com/6063053/diff/5001/src/pkg/syscall/zerrors_darw...
src/pkg/syscall/zerrors_darwin_386.go:149: ECHO =
0x8
On 2012/04/25 01:42:22, rsc wrote:
> Why did this change? These are auto-generated files but I don't see anything
> changing in the generators. Also, usually we handle constants by adding them
> here (via changes in the generators) not by explicit enumeration in
> types_darwin.go.
Done.
Issue 6063053: code review 6063053: syscall: add Termios support on darwin
(Closed)
Created 12 years ago by fss
Modified 12 years ago
Reviewers:
Base URL:
Comments: 4