Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Using ndbm on OSF Unix 3.2
@ 1996-10-28  5:00 Bob Vickers
  0 siblings, 0 replies; only message in thread
From: Bob Vickers @ 1996-10-28  5:00 UTC (permalink / raw)



Hello everyone,

I've been trying to use the ndbm routines but without success. This
little program fails with the strange error "not owner" (though it works
with the GNU emulation of ndbm). Am I doing something daft?

The program was compiled with 

	cc -o test7 -g2 -O0 -std1 test7.c
and is as follows:

#include <stdio.h>
#include <stdlib.h>
#include <ndbm.h>
#include <sys/mode.h>
#include <errno.h>
#include <fcntl.h>
#define DB_name  "dummy"
main() {
  DBM* db;

  datum key,content;
  int i;
  int stat;
  
  char string[10]="123456789";
  db =  dbm_open (DB_name, O_CREAT, S_IRWXU);
  if ( db == NULL)
    {
      perror("dbm_open failed");
      exit(1);
    }
  for (i=1;i<500000;i++) {

     if (i%500==0) printf("%d\n",i);    
     key.dsize=sizeof(i);
     key.dptr=(char *) (&i);

     content.dsize=sizeof(string);
     content.dptr=string;

     stat=dbm_store (db, key, content, DBM_INSERT);
  if ( stat != 0)
    {
      perror("dbm_store failed");
      exit(1);
    }
  }
  dbm_close (db);
}


Any suggestions gratefully received,
Bob
-- 
==============================================================================
Bob Vickers			R.Vickers@dcs.rhbnc.ac.uk
Department of Computer Science, Royal Holloway College, University of
London
WWW:	http://www.dcs.rhbnc.ac.uk/%7Ebobv/
Phone:	+44 1784 443691



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-10-28  5:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-28  5:00 Using ndbm on OSF Unix 3.2 Bob Vickers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox