# 2.11BSD#431 - /usr/ingres/source/iutil/dblocks.c

##### Functions

    setdbl            X
    unldb             X

##### Variables

    Lock              X

       1: # include   "../ingres.h"
       2: # include   "../lock.h"
       3: struct  lockreq Lock;
       4: /*
       5:  *	setdbl - set data base lock for either exclusive or shared
       6:  *		 access.
       7:  */
       8: setdbl(act, mod)
       9: char    act;            /* type request */
      10: char    mod;            /* mod of lock: = 1 for exclusive, = 2 for shared*/
      11: {
      12:     register char   *r;
      13:     register int    i;
      14:
      15: #	ifdef xATR1
      16:     if (tTf(98, 6))
      17:         printf(" setdbl a=%o m = %o\n", act, mod);
      18: #	endif
      19:     if (Alockdes < 0)
      20:         return (1);
      21:     Lock.lract = act;       /* type of request */
      22:     Lock.lrtype = T_DB;     /* data base lock */
      23:     Lock.lrmod = mod;       /* exclusive or shared */
      24:                     /* zero out rest of key */
      25:     r = Lock.lrel;
      26:     for (i = 0; i < 8; i++)
      27:         *r++ = 0;
      28:     i = write(Alockdes, &Lock, sizeof(struct lockreq));
      29:     return (i);
      30: }
      31: /*
      32:  *	unldb	- release the data base lock
      33:  */
      34: unldb()
      35: {
      36:     register char   *r;
      37:     register int    i;
      38:
      39: #	ifdef xATR1
      40:     if (tTf(98, 7))
      41:         printf(" unldb \n");
      42: #	endif
      43:     if (Alockdes < 0)
      44:         return (1);
      45:     Lock.lract = A_RLS1;        /* release 1 lock */
      46:     Lock.lrtype = T_DB;     /* a data base lock*/
      47:     r = Lock.lrel;
      48:     for (i = 0; i < 8; i++)     /* zero out part of key*/
      49:         *r++ = 0;
      50:     i = write(Alockdes, &Lock, sizeof(struct lockreq));
      51:     return (i);
      52: }

#### Defined functions

setdbl defined in line 8; used 1 times

- in /usr/ingres/source/iutil/initucode.c line 634

unldb defined in line 34; used 6 times

- in /usr/ingres/source/support/purge.c line 83, 137, 180, 225
- in /usr/ingres/source/support/restore.c line 145, 282

#### Defined variables

Lock defined in line 3; used 9 times

- in line 21-28(5), 45-50(4)

Last modified: 1995-02-19 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 477 |