~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/net/fd_windows.go

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-11-18 15:12:26 UTC
  • mfrom: (14.2.12 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141118151226-zug7vn93mn3dtiz3
Tags: 2:1.3.2-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - Support co-installability with gccgo-go tool:
    - d/rules,golang-go.install: Rename bin/go -> bin/golang-go
    - d/golang-go.{postinst,prerm}: Install/remove /usr/bin/go using
      alternatives.
  - d/copyright: Amendments for full compiliance with copyright format.
  - d/control: Demote golang-go.tools to Suggests to support Ubuntu MIR.
  - dropped patches (now upstream):
    - d/p/issue27650045_40001_50001.diff
    - d/p/issue28050043_60001_70001.diff
    - d/p/issue54790044_100001_110001.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
        o.buf.Len = uint32(len(buf))
120
120
        o.buf.Buf = nil
121
121
        if len(buf) != 0 {
122
 
                o.buf.Buf = (*byte)(unsafe.Pointer(&buf[0]))
 
122
                o.buf.Buf = &buf[0]
123
123
        }
124
124
}
125
125
 
313
313
        runtime.SetFinalizer(fd, (*netFD).Close)
314
314
}
315
315
 
316
 
func (fd *netFD) connect(la, ra syscall.Sockaddr) error {
 
316
func (fd *netFD) connect(la, ra syscall.Sockaddr, deadline time.Time) error {
317
317
        // Do not need to call fd.writeLock here,
318
318
        // because fd is not yet accessible to user,
319
319
        // so no concurrent operations are possible.
 
320
        if err := fd.init(); err != nil {
 
321
                return err
 
322
        }
 
323
        if !deadline.IsZero() {
 
324
                fd.setWriteDeadline(deadline)
 
325
                defer fd.setWriteDeadline(noDeadline)
 
326
        }
320
327
        if !canUseConnectEx(fd.net) {
321
328
                return syscall.Connect(fd.sysfd, ra)
322
329
        }
431
438
        return nil
432
439
}
433
440
 
434
 
func (fd *netFD) CloseRead() error {
 
441
func (fd *netFD) closeRead() error {
435
442
        return fd.shutdown(syscall.SHUT_RD)
436
443
}
437
444
 
438
 
func (fd *netFD) CloseWrite() error {
 
445
func (fd *netFD) closeWrite() error {
439
446
        return fd.shutdown(syscall.SHUT_WR)
440
447
}
441
448
 
458
465
        return n, err
459
466
}
460
467
 
461
 
func (fd *netFD) ReadFrom(buf []byte) (n int, sa syscall.Sockaddr, err error) {
 
468
func (fd *netFD) readFrom(buf []byte) (n int, sa syscall.Sockaddr, err error) {
462
469
        if len(buf) == 0 {
463
470
                return 0, nil, nil
464
471
        }
497
504
        })
498
505
}
499
506
 
500
 
func (fd *netFD) WriteTo(buf []byte, sa syscall.Sockaddr) (int, error) {
 
507
func (fd *netFD) writeTo(buf []byte, sa syscall.Sockaddr) (int, error) {
501
508
        if len(buf) == 0 {
502
509
                return 0, nil
503
510
        }
628
635
 
629
636
var errNoSupport = errors.New("address family not supported")
630
637
 
631
 
func (fd *netFD) ReadMsg(p []byte, oob []byte) (n, oobn, flags int, sa syscall.Sockaddr, err error) {
 
638
func (fd *netFD) readMsg(p []byte, oob []byte) (n, oobn, flags int, sa syscall.Sockaddr, err error) {
632
639
        return 0, 0, 0, nil, errNoSupport
633
640
}
634
641
 
635
 
func (fd *netFD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (n int, oobn int, err error) {
 
642
func (fd *netFD) writeMsg(p []byte, oob []byte, sa syscall.Sockaddr) (n int, oobn int, err error) {
636
643
        return 0, 0, errNoSupport
637
644
}