summaryrefslogtreecommitdiff
path: root/lang/modula-3-socks/files/getpeername.c
blob: 4da8eaa201b2d72b5a2ccbb0807aee494a58aa67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "wrap.h"
#include <sys/types.h>
#include <sys/socket.h>

int
m3_getpeername(int s, struct sockaddr *name, int *namelen)
{
  int result;

  ENTER_CRITICAL;
  MAKE_WRITABLE(name);
  MAKE_WRITABLE(namelen);
  result = getpeername(s, name, namelen);
  EXIT_CRITICAL;
  return result;
}