Annotation of researchv10dc/630/man/src/p_man/man3/decache.3l, revision 1.1.1.1

1.1       root        1: .TH DECACHE 3L
                      2: .XE "decache()"
                      3: .SH NAME
                      4: decache \- remove the calling application from the Application cache
                      5: .SH SYNOPSIS
                      6: \f3int decache ( )\f1
                      7: 
                      8: .SH DESCRIPTION
                      9: The function
                     10: .I decache
                     11: lets the calling application remove itself from the Application
                     12: cache.
                     13: .PP
                     14: The function \fIdecache\fR frees up all the system's information used to
                     15: cache the application but 
                     16: does not delete the application itself; it just
                     17: returns the memory occupied by the application back to the application, so it can be
                     18: automatically freed when the application exits or is deleted.
                     19: .PP
                     20: The function \fIdecache\fR returns a 1 if the operation is successful, a 0
                     21: otherwise. Failure can be caused by not finding the calling application in the
                     22: Application cache, and by finding the cached application is currently in use, or
                     23: cannot be removed (i.e. see the discussion on \fBA_PERMANENT\fR flag in 
                     24: \fIcache(3L)\fR).
                     25: 
                     26: .SH EXAMPLE
                     27: The following program illustrates the relationship
                     28: between \fIdecache\fR and \fIcache(3L)\fR.
                     29: .PP
                     30: .RS 3
                     31: .nf
                     32: .ft CM
                     33: #include <dmd.h>
                     34: #include <object.h>
                     35: 
                     36: main ()
                     37: {
                     38:        register int n;
                     39: 
                     40:        lprintf ("Type c to cache\\n");
                     41:        lprintf ("Type u to uncache\\n");
                     42:        lprintf ("Type q to quit");
                     43:        request (KBD);
                     44:        while (wait(KBD)) {
                     45:                n = kbdchar();
                     46:                lprintf ("\\ncharacter typed: %c", n);
                     47:                if (n == 'c') {
                     48:                        n = cache ("test", 0);
                     49:                        lprintf (" -- cache returns %d", n);
                     50:                } 
                     51:                else if (n == 'u') {
                     52:                        n = decache ();
                     53:                        lprintf (" -- decache returns %d", n);
                     54:                }
                     55:                else if (n == 'q') 
                     56:                        break;
                     57:        }
                     58: }
                     59: .fi
                     60: .RE
                     61: 
                     62: .SH SEE ALSO
                     63: ucache(1),
                     64: cache(3L), cmdcache(3L).

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.