home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!asuvax!farallon!NewsWatcher
- From: binky@farallon.com (Jeffrey B. Williams)
- Newsgroups: comp.sys.sun.misc
- Subject: ndbm(3)
- Message-ID: <binky-280792114824@192.100.87.178>
- Date: 28 Jul 92 19:19:02 GMT
- Sender: news@farallon.farallon.com
- Followup-To: comp.sys.sun.misc
- Organization: Farallon Computing
- Lines: 50
- Nntp-Posting-Host: 192.100.87.178
-
- I'm having trouble with the nbdm(3) library functions, specifically
- dbm_open() and dbm_fetch().
-
- problem 1, dbm_open():
-
- DBM *db;
- char *filespec;
- *
- *
- *
- filespec = "some_db_file";
- db = dbm_open(filespec,O_CREATE|O_RDWR,S_IRWXU);
-
- This statement leaves me, ostensibly, with a db that I can't dbm_store() to
- without getting a BUS error signal. One work around I use is:
-
- db = dbm_open(filespec,O_CREATE,S_IRWXU);
- dbm_close(db);
- db = dbm_open(filespec,O_RDWR,S_IRWXU);
-
- Is there a better way?
-
-
-
- problem 2, dbm_fetch():
-
- DBM *db
- datum db_record, key;
- *
- *
- *
- db = some_db_open_func();
-
- key.dptr = DB_REF_KEY;
- key.dsize = (int) sizeof(DB_REF_KEY);
-
- db_record = dbm_fetch(db, key);
-
- This statement ALWAYS yields me the SEGV error signal. (Even when I seed
- the DB with makedbm prior to execution.) Any ideas?
-
- What I really need is better documentation. Where can I find code samples,
- etc? I've read the BSD source for ndbm(3), and it seems that given THAT
- source this code should work.
-
- Please respond by email.
-
- Thank you for any help.
-
- Jeff (-:
-