File: listen.c

package info (click to toggle)
socks4-server 4.3.beta2-13
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,512 kB
  • ctags: 1,778
  • sloc: ansic: 19,305; makefile: 404; sh: 52
file content (31 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <sys/types.h>
#include <sys/socket.h>

#include <stdio.h>

#include "wrap.h"

int REAL(listen)(int  sockfd, unsigned int backlog )
{
  GETFUNC("listen", TRY_LIBC, -1, (int (*)(int  sockfd, unsigned int backlog )), (sockfd, backlog), int);
}

int  listen(int  sockfd, int backlog )
{
  int ret;

//  printf("listen(%d)\n", InSocksFunctions);

  InSocksFunctions++;

  if (InSocksFunctions == 1)
    ret = LIBPREFIX(listen)(sockfd, backlog);
  else
    ret = REAL(listen)(sockfd, backlog);

  InSocksFunctions--;

//  printf("listen(%d) ende\n", InSocksFunctions);

  return ret;
}