old-www/HOWTO/Implement-Sys-Call-Linux-2..../x59.html

169 lines
2.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>unistd.h</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Implementing a System Call on Linux 2.6 for i386"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="syscall_table.S"
HREF="x50.html"><LINK
REL="NEXT"
TITLE="syscalls.h"
HREF="x74.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Implementing a System Call on Linux 2.6 for i386</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x50.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x74.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN59"
></A
>6. unistd.h</H1
><P
>Full path of the file - /usr/src/linux/include/asm-i386/unistd.h</P
><P
>This file contains the system call number that is passed to the kernel through the register (EAX) when a system call is invoked. </P
><P
></P
><OL
TYPE="1"
><LI
><P
>Add "#define __NR_mycall &#60;Last_System_Call_Num + 1&#62;" at the end of the list.</P
></LI
></OL
><P
>If the last system call defined here is:</P
><P
>"#define __NR_vmsplice316", then add:</P
><P
>"#define __NR_mycall317" at the end of the list.</P
><P
></P
><OL
TYPE="1"
><LI
><P
>Increment the "NR_syscalls" by 1. So, if NR_syscalls is defined as:</P
></LI
></OL
><P
>"#define NR_syscalls 317", then change it to:</P
><P
>"#define NR_syscalls 318"</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x50.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x74.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>syscall_table.S</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>syscalls.h</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>