Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(884)

Issue 4271060: syscall: GetsockoptInt. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by albert.strasheim
Modified:
13 years, 11 months ago
Reviewers:
CC:
rsc, iant, golang-dev
Visibility:
Public.

Description

syscall: GetsockoptInt.

Patch Set 1 #

Patch Set 2 : diff -r 3be3d3cd4b7f https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 3be3d3cd4b7f https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 4 : diff -r 3be3d3cd4b7f https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 5 : diff -r 3be3d3cd4b7f https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 6 : diff -r 3be3d3cd4b7f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -4 lines) Patch
M src/pkg/syscall/syscall_linux.go View 1 2 3 4 5 2 chunks +7 lines, -1 line 0 comments Download
M src/pkg/syscall/syscall_linux_386.go View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M src/pkg/syscall/syscall_linux_amd64.go View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/syscall/syscall_linux_arm.go View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/syscall/zsyscall_linux_386.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/syscall/zsyscall_linux_amd64.go View 1 2 3 4 5 2 chunks +9 lines, -1 line 0 comments Download
M src/pkg/syscall/zsyscall_linux_arm.go View 1 2 3 4 5 2 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 15
albert.strasheim
Hello all Please review this change. GetsockoptInt is needed to implement CL 4306042. Regards Albert
13 years, 11 months ago (2011-03-23 07:26:45 UTC) #1
albert.strasheim
Whoops, not quite right yet. Fixing... On 2011/03/23 07:26:45, albert.strasheim wrote: > Hello all > ...
13 years, 11 months ago (2011-03-23 07:34:00 UTC) #2
albert.strasheim
PTAL. Linux only for now.
13 years, 11 months ago (2011-03-23 08:07:02 UTC) #3
rsc
http://codereview.appspot.com/4271060/diff/5001/src/pkg/syscall/syscall_linux.go File src/pkg/syscall/syscall_linux.go (right): http://codereview.appspot.com/4271060/diff/5001/src/pkg/syscall/syscall_linux.go#newcode420 src/pkg/syscall/syscall_linux.go:420: vallen := 4 should size this properly. len := ...
13 years, 11 months ago (2011-03-23 14:30:39 UTC) #4
albert.strasheim
PTAL On 2011/03/23 14:30:39, rsc wrote: > http://codereview.appspot.com/4271060/diff/5001/src/pkg/syscall/syscall_linux.go > File src/pkg/syscall/syscall_linux.go (right): > http://codereview.appspot.com/4271060/diff/5001/src/pkg/syscall/syscall_linux.go#newcode420 > ...
13 years, 11 months ago (2011-03-23 15:19:03 UTC) #5
rsc
http://codereview.appspot.com/4271060/diff/8001/src/pkg/syscall/syscall_linux_386.go File src/pkg/syscall/syscall_linux_386.go (right): http://codereview.appspot.com/4271060/diff/8001/src/pkg/syscall/syscall_linux_386.go#newcode133 src/pkg/syscall/syscall_linux_386.go:133: func getsockopt(s int, level int, name int, val uintptr, ...
13 years, 11 months ago (2011-03-23 15:26:37 UTC) #6
albert.strasheim
PTAL. On 2011/03/23 15:26:37, rsc wrote: > http://codereview.appspot.com/4271060/diff/8001/src/pkg/syscall/syscall_linux_386.go > File src/pkg/syscall/syscall_linux_386.go (right): > http://codereview.appspot.com/4271060/diff/8001/src/pkg/syscall/syscall_linux_386.go#newcode133 > ...
13 years, 11 months ago (2011-03-23 15:35:42 UTC) #7
rsc
very close http://codereview.appspot.com/4271060/diff/11001/src/pkg/syscall/syscall_linux_386.go File src/pkg/syscall/syscall_linux_386.go (right): http://codereview.appspot.com/4271060/diff/11001/src/pkg/syscall/syscall_linux_386.go#newcode138 src/pkg/syscall/syscall_linux_386.go:138: func setsockopt(s int, level int, name int, ...
13 years, 11 months ago (2011-03-23 17:35:06 UTC) #8
albert.strasheim
PTAL. On 2011/03/23 17:35:06, rsc wrote: > very close > > http://codereview.appspot.com/4271060/diff/11001/src/pkg/syscall/syscall_linux_386.go > File src/pkg/syscall/syscall_linux_386.go ...
13 years, 11 months ago (2011-03-23 18:29:14 UTC) #9
rsc
LGTM Thanks. Need to get Darwin and FreeBSD in order to submit the other CL. ...
13 years, 11 months ago (2011-03-23 18:33:33 UTC) #10
rsc
*** Submitted as 1ca16d1788ba *** syscall: GetsockoptInt. R=rsc, iant CC=golang-dev http://codereview.appspot.com/4271060 Committer: Russ Cox <rsc@golang.org>
13 years, 11 months ago (2011-03-23 18:33:50 UTC) #11
albert.strasheim
Hello On Wed, Mar 23, 2011 at 8:33 PM, Russ Cox <rsc@golang.org> wrote: > LGTM ...
13 years, 11 months ago (2011-03-23 18:40:45 UTC) #12
rsc
> Could you provide some guidance on how you see the next step, i.e., > ...
13 years, 11 months ago (2011-03-25 18:43:00 UTC) #13
albert.strasheim
On Fri, Mar 25, 2011 at 8:42 PM, Russ Cox <rsc@golang.org> wrote: >> Could you ...
13 years, 11 months ago (2011-03-26 08:00:09 UTC) #14
rsc
13 years, 11 months ago (2011-03-26 21:51:22 UTC) #15
> It seems that if you know that no goroutines are reading or writing,
> which will typically be the case with a server that just wants to rid
> itself of a socket already passed to a client process, you can do:
>
> conn.Fd().Close()
> conn.Close()
>
> However, if the server has multiple goroutines doing this kind of
> thing, I think you could end up calling Shutdown on a "valid invalid"
> file descriptor, because conn.Fd().Close() isn't going to set fd.sysfd
> to -1.
>
> So maybe we need conn.CloseFd() so that this can be achieved?

I hope not.  I'd prefer to remove the use of shutdown entirely,
but I am not sure whether we can.  We're not actually trying to
shut down the network connection by using it.  What we want to
avoid is:

    * goroutine 1: find fd = 3, decide to use it.
    * goroutine 2: find fd = 3, close(3)
    * goroutine 3: create new network connection, gets fd 3
    * goroutine 1: use fd 3, expecting old network connection,
          but actually get new one.

The current code calls shutdown during Close so that the
i/o gets stopped without confusing goroutine 1 in the example
above.  With a little more coordination we might be able to
go back to using close directly.

Russ
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b