Can anyone help with the table call ?

From: Eric Wyn Jones (01248-382407) <"Eric>
Date: Wed, 23 Apr 1997 10:10:37 +0100 (BST)

Hello,
       I'm trying to use the table system call to get a list of
processes ( home brew ps -A)

According to the man page for table :-
  ...
  The table() interface returns a count of the elements examined or updated.
  The id TBL_PROCINFO allows you to determine the actual number of elements
  in a table before requesting any data; call table() with lel set to zero
  (0) and nel to the maximum positive integer.
  ...


  The following returns the value 4096 on my Alpha 2100 running DU 4.0B

        n=table(TBL_PROCINFO,0,(char *)0 ,1073741823 , 0 );
        if (n == -1) {
                perror("table error");
                exit(1);
        }

  However it seems the entries in this table are indexed by pid and some
  pids are greater than 4096. In fact I can call table with indices up
  to 32767 without getting an error return and I get information returned
  for entries > 4096 .

  So my question is :- Is the first call to table to get number of elements
   incorrect or what ?


 -----------------------------------------------------------------------
| Eric Wyn Jones, | |
| Information Services, | |
| University of Wales, Bangor | |
 -----------------------------------------------------------------------
Received on Wed Apr 23 1997 - 11:33:08 NZST

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