Mark
Mark

Reputation: 6484

OracleSolaris 11.2 -- similar mechanism to Linux procfs

In Linux it is common to use proc FS as a means to talk with a kernel module, receive statistics from the kernel or set up some flags. What can be used for these in Solaris?

Upvotes: 1

Views: 65

Answers (2)

James McPherson
James McPherson

Reputation: 2576

What you'd do in Solaris is use kstats(3kstat) to provide info about your driver as @jilliagre mentioned. If you want to kick your driver to do things, then you should provide that facility via ioctl(2).

Upvotes: 1

jlliagre
jlliagre

Reputation: 30823

procfs was initially designed to permit access to process related information. On Linux, this goal derailed and various non process related pseudo files and directories started to be present there. This is slowly being corrected by relocating (some of) them in /sys which uses sysfs and not procfs.

There has not been such issue with Solaris where procfs is strictly restricted to process data. One main difference between Solaris and Linux procfs implementations is Linux is often providing plain text data where Solaris is exposing binary structures.

For non process related statistics, the common Solaris interface is an API, kstat(3kstat) which is used by many commands and can also be queried from the shell with the kstat(1) command.

The way to set flags and "communicate" with the kernel depends on precisely what need to be done, there is no single interface. It also evolved depending on the Solaris releases.

Upvotes: 3

Related Questions