2004-09-05 18:16:57

by Eric Bambach

[permalink] [raw]
Subject: Quick Syscall question

Hello,

This may seem like a silly question, however we were all beginning
programmers once ;)

I want to do some manipulating of network interfaces and routing and such. I
am reading through some of the linux net sources but am confused on what are
internal, kernel-only functions and what are externally visable syscalls. How
can I tell from the source what is user-space visable that I can hook into
and what is intternel stuff? Should I just be looking at headers or do I have
to delve into the .c sources? I can do either, I just need a pointer on where
to start and what I should be looking for.

Thanks
--

-EB


2004-09-05 18:43:08

by Randy.Dunlap

[permalink] [raw]
Subject: Re: Quick Syscall question

On Sun, 5 Sep 2004 13:17:42 -0500 Eric Bambach wrote:

| Hello,
|
| This may seem like a silly question, however we were all beginning
| programmers once ;)
|
| I want to do some manipulating of network interfaces and routing and such. I
| am reading through some of the linux net sources but am confused on what are
| internal, kernel-only functions and what are externally visable syscalls. How
| can I tell from the source what is user-space visable that I can hook into
| and what is intternel stuff? Should I just be looking at headers or do I have
| to delve into the .c sources? I can do either, I just need a pointer on where
| to start and what I should be looking for.

Most syscalls are listed in include/linux/syscalls.h.
Also look in include/asm-*/unistd.h.
Also in entry.S in arch/*/ (various sub-directory levels).

--
~Randy

2004-09-05 22:17:20

by Neil Horman

[permalink] [raw]
Subject: Re: Quick Syscall question

Randy.Dunlap wrote:

>On Sun, 5 Sep 2004 13:17:42 -0500 Eric Bambach wrote:
>
>| Hello,
>|
>| This may seem like a silly question, however we were all beginning
>| programmers once ;)
>|
>| I want to do some manipulating of network interfaces and routing and such. I
>| am reading through some of the linux net sources but am confused on what are
>| internal, kernel-only functions and what are externally visable syscalls. How
>| can I tell from the source what is user-space visable that I can hook into
>| and what is intternel stuff? Should I just be looking at headers or do I have
>| to delve into the .c sources? I can do either, I just need a pointer on where
>| to start and what I should be looking for.
>
>Most syscalls are listed in include/linux/syscalls.h.
>Also look in include/asm-*/unistd.h.
>Also in entry.S in arch/*/ (various sub-directory levels).
>
>--
>~Randy
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
>
Also, if you're looking into writing kernel modules, anything listed in
arch/*ksyms.c as a symbol inside an EXPORT_SYMBOL block is accessible,
although that may not mean its available from user space.
Neil

--
/***************************************************
*Neil Horman
*Software Engineer
*Red Hat, Inc.
*[email protected]
*gpg keyid: 1024D / 0x92A74FA1
*http://pgp.mit.edu
***************************************************/