Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

socketpair buffer limits?



Hi!

On my machine, the attached program (which sets the send and receive
buffers for a socketpair() to 1MB each) works, on pin@'s it doesn't.

Which limits restrict this?
 Thomas
#include <sys/socket.h>
#include <err.h>
#include <stdint.h>

#define BUFSIZE 1024 * 1024

int main() {
  int fds[2];
  uint32_t bufsize = BUFSIZE;
  if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0)
    err(1, "socketpair");
  if (setsockopt(fds[0], SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(bufsize)) < 0)
    err(1, "SNDBUF");
  if (setsockopt(fds[1], SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize)) < 0)
    err(1, "RCVBUF");
  return 0;
}


Home | Main Index | Thread Index | Old Index