Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (HP-UX-11.11)
Apropos / Subsearch:
optional field

 sysfs(2)							    sysfs(2)

      sysfs - get file system type information

      #include <&lt&lt&lt;sys/fstyp.h>&gt&gt&gt;

      int sysfs(int opcode, const char *fsname);

      int sysfs(int opcode, int fs_index, char *buf );

      int sysfs(int opcode);

      sysfs is used to return information about the file system types
      configured in the system.	 The number arguments accepted by sysfs
      varies and depends on the opcode.

      The current recognized opcodes and their functions are:

	   GETFSIND	  Translate fsname, a null-terminated file-system
			  type identifier, into a file-system type index.

	   GETFSTYP	  Translate fs_index, a file-system type index, into
			  a null-terminated file-system type identifier and
			  write it into the buffer pointed to by buf; this
			  buffer must be at least of size FSTYPSZ as defined
			  in <&lt&lt&lt;sys/fstyp.h>&gt&gt&gt;. If there is no file-system type
			  configured at fs_index, a null string is returned
			  for the file-system type identifier.

	   GETNFSTYP	  Return one more than the largest file system type
			  configured.  This is not the number of file system
			  types configured, because the type numbers may not
			  be contiguous.  See the example below.

      Upon successful completion, sysfs() returns the file-system type index
      if the opcode is GETFSIND, a value of 0 if the opcode is GETFSTYP, or
      the number of file system types configured if the opcode is GETNFSTYP.
      Otherwise, a value of -1 is returned and errno is set to indicate the

      sysfs fails if one or more of the following are true and sets errno to
      the value indicated:

	   EINVAL      fsname points to an invalid file-system identifier;
		       fs_index is negative or greater than the largest
		       file-system type index; opcode is invalid.

 Hewlett-Packard Company	    - 1 -   HP-UX Release 11i: November 2000

 sysfs(2)							    sysfs(2)

	   EFAULT      buf or fsname points to an invalid user address.

      List the filesystem types configured in the system.

	   #include <&lt&lt&lt;sys/fstyp.h>&gt&gt&gt;

	   int max_type, error, i;
	   char name[FSTYPSZ];
	   max_type = sysfs(GETNFSTYP);
	   for (i = 0; i <&lt&lt&lt; max_type; i++) {
		   error = sysfs(GETFSTYP, i, name);
		   if (error == 0)

 Hewlett-Packard Company	    - 2 -   HP-UX Release 11i: November 2000