O'Reilly logo

Solaris™ Internals: Solaris 10 and OpenSolaris Kernel Architecture, Second Edition by Richard McDougall, Jim Mauro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

B. Adding a System Call to Solaris

Contributed by Eric Schrock

In this appendix, we provide an example of how to add a system call to Solaris.

B.1. Setting Kernel Parameters

For the purposes of this appendix, we will assume that it’s a simple system call that lives in the generic kernel code, and we’ll put the code into an existing file to avoid having to deal with Makefiles. The goal is to print an arbitrary message to the console whenever the system call is issued.

B.1.1 Picking a Syscall Number

Before writing any real code, we first have to pick a number that will represent our system call. The main source of documentation here is syscall.h, which describes all the available system call numbers, as well as which ones are reserved. The maximum ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required