LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 |
LEFT | RIGHT |