Subject: help w/ shmat()
To: None <netbsd-help@netbsd.org>
From: Dave B <spam@dberg.net>
List: netbsd-help
Date: 12/02/2004 15:31:43
  Under NetBSD 1.5.3++, shmat() is failing with ENOMEM.  The port it
fails on is Atari, but the same operation works fine under Alpha and
i386 (also 1.5.3++).  Apologies, the test code below has to be run
under ktrace for the symptom to be seen.

  I do have the options SYSV{MSG,SEM,SHM} in my kernel config (plus,
the shmget() succeeding).  I've tried unlimiting datasize w/ulimit
with no luck.  Is there something else I'm forgetting to configure?
Any resource limits I'm not thinking of?  If not, and it's a bug, is
there any use in submitting a PR, or is 1.5 retired?

Many thanks in advance,

--Dave

======================================================================
#include <sys/shm.h>

#define KEY 9999
int
main(int argc, char *argv[])
{

  int iShmId;
  void *pvAddr;

/*
  iShmId = shmget(KEY, 0x1660, 0);
*/
  iShmId = shmget(KEY, 0x1660, 0x780);

  (void) getchar();

  pvAddr = shmat(iShmId, 0, 0);

}
======================================================================