Re: get_pid() question

From: Russell King (rmk@arm.linux.org.uk)
Date: Sun Jun 25 2000 - 05:49:42 EST


Manfred Spraul writes:
> Why is the pid value limited to 15 bits on _all_ architectures?
> I read somewhere that libc5-i386 is restricted to signed short, but what
> about the other architectures?
>
> And get_pid() doesn't contain an "out of pid" detection. AFAICS one
> thread can block 3 pid values (pid, pgrp, session), we must limit the
> number of threads to 10.000 on i386.

1. get_pid() doesn't allocate pids - therefore "out of pid" makes no
   sense.

2. pid, pgrp and session are not individually unique. Indeed, session
   leader (login on most pam'd systems) will have pid == pgrp == session.
   Check out ps -o user,pid,session,pgrp,tty,stat,start_time,cmd -ax
   to see the relationships.

Typically, a processes "session id" will be the pid of another process,
and the "pgrp id" will be the pid of the first process of the group.
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:06 EST