unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OSF1-V5.1-alpha)
Page:
Section:
Apropos / Subsearch:
optional field



setsysinfo(2)							setsysinfo(2)



NAME

  setsysinfo - Sets system information

SYNOPSIS

  #include <&lt;sys/sysinfo.h>&gt;
  #include <&lt;machine/hal_sysinfo.h>&gt;

  setsysinfo(op, buffer, nbytes, arg, flag)
	  unsigned long	op;
	  datatype *buffer;
	  unsigned long	nbytes;
	  datatype *arg;
	  unsigned long	flag;

PARAMETERS

  op  Specifies	the operation to be performed. Values for op are defined in
      the <&lt;sys/sysinfo.h>&gt; and <&lt;machine/hal_sysinfo.h>&gt; header files. See	the
      DESCRIPTION for the operations you can specify.

  buffer, nbytes
      The nbytes argument defines the size of buffer. The buffer argument
      specifies	the location where the system information is returned and its
      datatype depends on the data type	of buffer.

  arg, flag
      The optional arg and flag	arguments can be used by certain op values to
      obtain additional	information. The arg datatype depends on the data
      type of arg.  When arg and/or flag are not required, they	should be set
      to NULL.

DESCRIPTION

  The setsysinfo system	call modifies system information. The op argument
  specifies the	operation to be	performed. Values for op are defined in	the
  <&lt;sys/sysinfo.h>&gt; and <&lt;machine/hal_sysinfo.h>&gt; header files. The	optional
  buffer and nbytes arguments are used to pass data, which varies depending
  upon op. When	buffer and nbytes are not required, they should	be set to
  NULL.	The optional arg argument can be used with certain op values for
  additional information. When arg is not required, it should be set to	NULL.
  The optional flag argument can be used with certain op and arg values	for
  additional information. When flag is not required it should be set to	NULL.

  Possible op values are:

  SSI_FD_NEWMAX
      For support of up	to 64K file descriptors	per process. If	the flag is
      set to one, the utask bit	is set and support for up to 64K file
      descriptors is enabled. Additionally, the	process's hard file limit is
      raised to	64K.

      If the flag is set to zero, the utask bit	is cleared and support for up
      to 64K file descriptors is disabled. The process's hard file limit
      returns to the default maximum of	4K. If the process is using more than
      4K file descriptors, the process's hard file limit is not	changed: EIN-
      VAL is returned. If either the process's hard or soft limit is above
      4K, that limit is	set to 4K.

  SSI_NVPAIRS
      This operation uses pairs	of values or their named equivalents to
      modify system behavior. The buffer variable is an	array of paired
      values (or their named equivalents). One member of a pair	is from	a set
      of system	names defined in the <&lt;sys/sysinfo.h>&gt; header file.

      The other	member can be one of the following: A_BSD, A_POSIX, A_SYSV, a
      system name defined as a flag for	UAC (unaligned access control),	or an
      IEC (Instruction Emulation Control) flag in the <&lt;sys/proc.h>&gt; header
      file and set on a	per task basis.

      The following UAC	flags can be specified in any combination:
      UAC_NOPRINT, UAC_NOFIX, and UAC_SIGBUS.

      UAC_NOPRINT suppresses the printing of the unaligned error message to
      the user.

      UAC_NOFIX	instructs the operating	system not to fix the unaligned
      access fault.

      UAC_SIGBUS causes	a SIGBUS signal	to be delivered	to the thread.

      The following IEC	flags can be specified in any combination:
      IEC_VERBOSE, IEC_NOPRINT,	and IEC_NOEMUL.

      IEC_VERBOSE prints the instruction emulated message for each instruc-
      tion emulation, not just the first.

      IEC_NOPRINT suppresses printing of the instruction emulated message to
      the user.

      IEC_NOEMUL instructs the operating system	to deliver a SIGILL to the
      user instead of emulating	instructions not supported by the host pro-
      cessor.

      UAC and IEC settings are inherited by a forked process so	that the pro-
      cess will	have the same UAC and IEC characteristics as its parent.

      Possible name values for the first member, are:

      SSIN_NFSPORTMON
	  Determines whether incoming NFS traffic is originating at a
	  privileged port or not. Its paired value must	be 0 or	1.

      SSIN_PROG_ENV
	  Reserved for future use.

      SSIN_UACSYS
	  This is a system-specified value that	accepts	the UAC_NOPRINT	flag
	  only,	as its paired value, even if other UAC flags are specified.
	  Accordingly, it toggles an "unaligned	access fixup" message. Use of
	  this value is	restricted to the superuser and	supersedes a user
	  setting that requests	printing.

      SSIN_UACPARNT
	  A value that is set in the current process's parent proc structure.
	  This value is	paired with the	UAC flags UAC_NOPRINT, UAC_NOFIX, and
	  UAC_SIGBUS, specified	in any combination with	inclusive OR. Accord-
	  ingly, it toggles printing of	an "unaligned access fixup" message,
	  fixing of UAC	faults,	and delivery of	a SIGBUS signal	to the
	  thread. This value is	inherited across forks and execs. If parent
	  is init, the system call returns EPERM.

      SSIN_UACPROC
	  A value that is set in the proc structure.  This value is paired
	  with UAC flags UAC_NOPRINT, UAC_NOFIX, and UAC_SIGBUS, specified in
	  any combination, with	inclusive OR. Accordingly, it toggles print-
	  ing of an "unaligned access fixup" message, fixing of	UAC faults,
	  and delivery of a SIGBUS signal to the thread.

      SSIN_IECSYS
	  This is a system-specified value that	accepts	only the IEC_NOPRINT
	  flag as its paired value, even if other IEC flags are	specified.
	  Accordingly, it toggles an "instruction emulated" message. Use of
	  this value is	restricted to the superuser and	supersedes a user
	  setting that requests	printing.

      SSIN_IECPARNT
	  A value that is set in the current process's parent proc structure.
	  This value is	paired with the	IEC flags IEC_VERBOSE, IEC_NOPRINT,
	  and IEC_NOEMUL, specified in any combination with inclusive OR.
	  Accordingly, it toggles verbose printing of "instruction emulated",
	  not printing "instruction emulated", and not emulating instruc-
	  tions. This value is inherited across	forks and execs. If the
	  parent is init, the system call returns EPERM.

      SSIN_IECPROC
	  A value that is set in the proc structure.  This value is paired
	  with the IEC flags IEC_VERBOSE, IEC_NOPRINT, and IEC_NOEMUL, speci-
	  fied in any combination, with	inclusive OR. Accordingly, it toggles
	  verbose printing of "instruction emulated", not printing "instruc-
	  tion emulated", and not emulating instructions.

	  The value is a legal value for name. The nbytes argument defines
	  the number of	pairs in buffer. The arg and flag arguments are	not
	  used.

  SSI_PROM_ENV
      Sets the value of	a named	console	environment variable. If the variable
      is disabled due to a known firmware problem, then	errno will contain
      EACCES.

      buffer
	  Specifies the	location of the	string value.

      arg A string containing the name of the console environment variable.

      flag
	  If the flag contains PROM_CONVERT_TYPE (defined in <&lt;prom.h>&gt;),	then
	  the kernel does value	conversion.  Device values should be speci-
	  fied as a fully qualified path to a device special file. For net-
	  work devices,	the controller name (e.g. tu2) should be provided.
	  The kernel will convert these	device references to the native	con-
	  sole bootstring format. Integer values should	be specified as
	  strings, which the kernel will convert to binary form.

  SSI_PROM_SAVE_ENV
      Saves the	values of all console environment variables to non-volatile
      storage. If saving is disabled due to a known firmware problem, then
      errno will contain EACCES.

  SSI_ZERO_STRUCT
      Each member of a system structure	is set to zero.	The arg	defines	the
      structure	type.

      Possible values for arg are:

      SSIS_NFS_CLSTAT
	  NFS client statistics.

      SSIS_NFS_SVSTAT
	  NFS server statistics.

      SSIS_RPC_STAT
	  RPC statistics. The flag argument is used for	a particular arg
	  value, to further define the operation or a resultant	action to be
	  performed. The buffer	and nbytes arguments are not used.

	  Permission checking is done on a structure-by-structure basis.

  SSI_SET_STRUCT
      Each member of a system structure	is set to a supplied value.  The arg
      defines the structure type.

      Possible values for arg are as defined for op SSI_STRUCT_ZERO. The flag
      argument is used for a particular	arg value, to further define the
      operation	or a resultant action to be performed. The buffer argument is
      the address of a structure of the	appropriate type that contains the
      desired values. The nbytes argument specifies the	amount of data to be
      transferred that is stored at buffer.

RETURN VALUES

  A zero (0) is	returned if the	call succeeds.	If the call fails, -1; is
  returned, and	the global variable errno is set to indicate the error.

ERRORS

  [EFAULT ]
      Either buffer or arg causes an illegal address to	be referenced.

  [EINVAL]
      The op, arg, or flag argument is invalid.

      The process has more than	4K file	descriptors active when	a call is
      issued to	disable	support	for more than 4K file descriptors.

  [EPERM]
      Permission is denied for the operation requested.

EXAMPLES

   1.
	    #include <sys/sysinfo.h>;
	    #include <machine/hal_sysinfo.h>;
	    #include <sys/proc.h>;
	    &.
	    int	buf[2],	val, arg;
	    .
	    /*	Don't print the	warning	to the user */
	    buf[0] = SSIN_UACPROC;
	    buf[1] = UAC_NOPRINT;
	    error = setsysinfo(SSI_NVPAIRS, buf, 1, 0, 0);
	    .
	    .
	    .
	    /* Deliver a SIGBUS	signal and don't print the warning */
	    buf[0] = SSIN_UACPROC;
	    buf[1] = UAC_SIGBUS	| UAC_NOPRINT;
	    error = setsysinfo(SSI_NVPAIRS, buf, 1, 0, 0);

   2.  The following example shows that	you can	pass more than one pair	of
       values to the SSI_NVPAIRS call. Notice that members of a	pair are con-
       tiguous,	and an SSI_* value appears in the even number position begin-
       ning with array position	[0].


	    buf[0] = SSIN_UACPARNT;
	    buf[1] = UAC_NOPRINT;
	    buf[2] = SSIN_NSFPORTMON;
	    buf[3] = 1;
	    if (setsysinfo(SSI_NVPAIRS,	buf, 2,	0, 0) <&lt;	0)
	     {
		perror("setsysinfo");
		return;
		       }

   3.  In the following	example	the setsysinfo operation SSI_PROM_ENV sets
       the value of a named console environment	variable:


	    #include <machine/prom.h>;

	    char evname[]="boot_dev";
	    char evval[]="/dev/rz0a";	   /* or something like	"tu0" */
	    int	status;
	    status = setsysinfo(SSI_PROM_ENV,evval, strlen(evval)+1,
				evname,	PROM_CONVERT_TYPE;




SEE ALSO

  iec(1), uac(1), getsysinfo(2)