kproc man page on Inferno

Man page or keyword search:  
man Server   579 pages
apropos Keyword Search (all sections)
Output format
Inferno logo
[printable version]

KPROC(10.2)							   KPROC(10.2)

NAME
       kproc,  setpri,	swiproc,  pexit	 -  kernel  process creation, priority
       change, interrupt and termination

SYNOPSIS
       void  kproc(char *name, void (*func)(void*), void *arg, int flags);

       int   setpri(int pri);

       void  swiproc(Proc *p, int interp);

       void  pexit(char*, int);

DESCRIPTION
       Kproc creates a new Inferno kernel process to run  the  function	 func,
       which  is  invoked as (*func)(arg).  The string name is copied into the
       text field of the Proc structure of the new process; although the value
       is  not visible to Limbo applications, it can appear in system messages
       written to the console.	The process is made runnable; it will run when
       selected by the scheduler.

       The  new process always acquires the following attributes from the cre‐
       ating process:

	      owner (Inferno user name)
	      host user and group IDs (in emu only)
	      floating-point attributes

       Several resources can be shared with the creating process  on  request,
       as determined by flags, which is the logical OR of a subset of the fol‐
       lowing:

       KPDUPPG
	      If set, the new process shares the caller's process group, which
	      includes its process group ID (for killgrp), name space (mounts,
	      root and current directory), and PIN for /dev/pin (see cons(3)).

       KPDUPFDG
	      If set, the new process  shares  the  caller's  file  descriptor
	      group;  otherwise,  it  has no file descriptor group, and (if it
	      intends to open files) must  call	 newfgrp(10.2)	to  obtain  an
	      empty file descriptor group.

       KPDUPENVG
	      If  set,	the  new process shares the caller's environment group
	      (currently applies in emu only).

       KPDUP  Equivalent to all of the above.

       If a particular option is not set, the new process will have a nil ref‐
       erence for the corresponding resource.

       Setpri  sets the priority of the calling process to pri and returns its
       previous priority level.	 If a (now) higher priority process  is	 ready
       to  run, the system will reschedule.  The available priority levels are
       shown below, arranged from highest to lowest priority, with examples of
       the type of processes intended to use them:

       PriLock
	      The  highest priority, used by lock(10.2) for a process entering
	      a critical section

       PriRealtime
	      Intended for processes supporting	 applications  with  real-time
	      constraints, such as video telephony.

       PriHicodec
	      MPEG codec

       PriLocodec
	      Audio codec

       PriHi  Any task with keen time constraints.

       PriNormal
	      The priority of most processes in the system.

       PriLo

       PriBackground

       Swiproc	sends  a  software  interrupt to process p, causing it to wake
       from sleep(10.2) with an error(10.2) `interrupted'.  Unless  interp  is
       non-zero	 (ie,  the Dis interpreter is the caller), the process is also
       marked `killed'.

       An Inferno process terminates only when it calls pexit, thereby	termi‐
       nating itself.  There is no mechanism for one process to force the ter‐
       mination of another, although it can send a  software  interrupt	 using
       swiproc.	  The  arguments  to  pexit  are  ignored  in Inferno, but are
       included for compatibility with kernel components of Plan 9; use

	      pexit("", 0);

								   KPROC(10.2)
[top]

List of man pages available for Inferno

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net