()
| 480 | } |
| 481 | |
| 482 | func (s *Socket) Errno() unix.Errno { |
| 483 | if !s.FD.IncRef() { |
| 484 | return unix.EBADF |
| 485 | } |
| 486 | defer s.FD.DecRef() |
| 487 | |
| 488 | switch cur := s.Inode.state.Load(); cur.state { |
| 489 | case StatePassive: |
| 490 | return cur.passive.errno |
| 491 | default: |
| 492 | return 0 |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | func (s *Socket) Listen(backlog int) (syscall.Errno, error) { |
| 497 | if !s.FD.IncRef() { |
no test coverage detected