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

Delta Between Two Patch Sets: src/pkg/syscall/syscall_linux.go

Issue 7058062: code review 7058062: syscall: handle empty address in ReadFrom better (Closed)
Left Patch Set: diff -r 7bc28d72d49c http://code.google.com/p/go Created 11 years, 2 months ago
Right Patch Set: diff -r f6172d444cc0 http://code.google.com/p/go Created 11 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« src/pkg/net/unix_test.go ('K') | « src/pkg/syscall/syscall_bsd.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Linux system calls. 5 // Linux system calls.
6 // This file is compiled as ordinary Go code, 6 // This file is compiled as ordinary Go code,
7 // but it is also input to mksyscall, 7 // but it is also input to mksyscall,
8 // which parses the //sys lines and generates system call stubs. 8 // which parses the //sys lines and generates system call stubs.
9 // Note that sometimes we use a lowercase //sys name and 9 // Note that sometimes we use a lowercase //sys name and
10 // wrap it in our own nicer implementation. 10 // wrap it in our own nicer implementation.
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 409 }
410 return sa, nil 410 return sa, nil
411 } 411 }
412 return nil, EAFNOSUPPORT 412 return nil, EAFNOSUPPORT
413 } 413 }
414 414
415 func Accept(fd int) (nfd int, sa Sockaddr, err error) { 415 func Accept(fd int) (nfd int, sa Sockaddr, err error) {
416 var rsa RawSockaddrAny 416 var rsa RawSockaddrAny
417 var len _Socklen = SizeofSockaddrAny 417 var len _Socklen = SizeofSockaddrAny
418 nfd, err = accept(fd, &rsa, &len) 418 nfd, err = accept(fd, &rsa, &len)
419 if err != nil {
420 return
421 }
422 sa, err = anyToSockaddr(&rsa)
423 if err != nil {
424 Close(nfd)
425 nfd = 0
426 }
427 return
428 }
429
430 func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
431 var rsa RawSockaddrAny
432 var len _Socklen = SizeofSockaddrAny
433 nfd, err = accept4(fd, &rsa, &len, flags)
419 if err != nil { 434 if err != nil {
420 return 435 return
421 } 436 }
422 sa, err = anyToSockaddr(&rsa) 437 sa, err = anyToSockaddr(&rsa)
423 if err != nil { 438 if err != nil {
424 Close(nfd) 439 Close(nfd)
425 nfd = 0 440 nfd = 0
426 } 441 }
427 return 442 return
428 } 443 }
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 // Tuxcall 1101 // Tuxcall
1087 // Umount2 1102 // Umount2
1088 // Uselib 1103 // Uselib
1089 // Utimensat 1104 // Utimensat
1090 // Vfork 1105 // Vfork
1091 // Vhangup 1106 // Vhangup
1092 // Vmsplice 1107 // Vmsplice
1093 // Vserver 1108 // Vserver
1094 // Waitid 1109 // Waitid
1095 // _Sysctl 1110 // _Sysctl
LEFTRIGHT

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