ITEM: AN3936L

Replacement for max_proc at AIX V4.1



Question:

Env: 

Upgraded from AIX 3.2.5 to AIX 4.1

Desc: 

Customer has an in-house developed program which worked under 3.2.5
but now fails under 4.1.  The knlist() function which successfully 
retrieved symbols proc and max_proc under 3.2.5 fails to retrieve 
max_proc under 4.1.

Customer was using the knlist() subroutine to retrieve proc and
max_proc and then using these variable (max_proc - proc) in order to
determine the size of the process table.  They then used this value to
determine how much space to allocate in order to read in and store the
process table.

Action:

max_proc has changed and is no longer an external structure as it was
with AIX 3.2.  The max_proc variable is defined in the 
/usr/include/sys/proc.h file.

In AIX 3.2:

  extern  struct proc *max_proc;

In AIX 4.1:

  \#define max_proc ((struct proc *)v.ve_proc)

So, it is quite different in AIX 4.1 and is not viewable via the
knlist subroutine or the knlist subcommand in crash.

In the All About AIX Version 4 guide or the AIX 4.1 Porting Guide, 
you will find the following:

  In AIX Version 3, the kernel exported the variables csa, proc,
  and u.  The use of these fields with kernel extensions was not
  documented or supported.  If a kernel extension references these
  structure, then they will not load in AIX Version 4.1  To work
  around this problem, the kernel extensions will have to be
  recoded to use the following routines:

  e_wakeup_w_sig
  i_disable
  getexcept
  getctty/setctty
  getpid
  getuerror/setuerror
  limit_sigs
  rusage_incr
  sigsetmask
  sig_chk
  thread_self

Although not mentioned in the above reference, at AIX 3.2, max_proc 
was the high water mark for the process table.  However, due to 
changes made in order to implement threads, the max_proc variable was 
removed.  

At AIX 4.1, you can use the sysconfig system call to get the following
values:

  vb_proc         beginning of proc table.
  ve_proc         high water mark of proc table.
  vb_thread       beginning of thread table.
  ve_thread       high water mark of thread table.

These are the values you will want to use instead of max_proc.


Support Line: Replacement for max_proc at AIX V4.1 ITEM: AN3936L
Dated: August 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:26
Comments or suggestions? Contact us