Need example of swapctl(2) SC_LIST

From: Jonathan Rozes <jrozes_at_tufts.edu>
Date: Wed, 22 Mar 1995 13:36:50 -0500 (EST)

Hi--

[This is with OSF/1 3.0]

I'd like to be able to get a list of the currently active swap devices,
which I should be able to do with swapctl(2)'s SC_LIST command. However,
I'm always getting ENOMEM back, which according to the man page, means
there are not enough struct swapent structures. I noticed that the header
file <sys/swap.h> defines the struct swaptable as follows:

typedef struct swaptable {
        int swt_n; /* number of swapents following */
        struct swapent swt_ent[1]; /* array of swt_n swapents */
} swaptbl_t;

This seems wrong to me. Am I reading this wrong, or does this mean that
SC_LIST will fail if you have more than one swap device active? If so,
I'm not sure how to fix it. Any help and/or example code would be muchly
appreciated...

Thanks,
jonathan

+++ Jonathan Rozes, jrozes_at_tufts.edu, jrozes_at_cs.tufts.edu
+++ http://www.tufts.edu/~jrozes/
+++ Mind Over Liver: The liver probably contains 100 million cells, but
    1,000 livers do not add up to a rich inner life. <GDF:SA 09/92>
Received on Wed Mar 22 1995 - 13:37:51 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT