alt.linux, alt.os.linux, comp.os.linux.redhat

alt.linux, alt.os.linux, comp.os.linux.redhat

Post by prasha » Tue, 15 Oct 2002 08:54:38



Hi!All

I am really sorry for this long mail, but it si urgent, so plz try ur best
to help me asap.

{MY AIM :- to modify the socket.c program in linux src code and
successfully   }{compile this modifed code. I just giving a print
satetement in socket.c. SO   }{that when the socket.o is used by some
socket program, it should use this new }{modified socket.o (i.e it
should display by default the contents of the print }{statement which
i added)}.

I have been trying to compile the socket.c program which i got from
the usr/src/linux/net dictory in linux. I am using RHL 7.3, but the
program gives the follwoing error:


In file included from socket.c:82:
/usr/include/asm/uaccess.h:1:3: unterminated #ifndef
In file included from /usr/include/net/checksum.h:32,
                 from /usr/include/net/tcp.h:30,
                 from /usr/include/net/tux.h:38,
                 from socket.c:86:
/usr/include/asm/uaccess.h:1:3: unterminated #ifndef

I am unable to understand what "unterminated #ifndef" signifies. I got
these errors on compilation of only socket.c(Can i compile socket.c
individually?). If NO then how do i compile it.

 
 
 

alt.linux, alt.os.linux, comp.os.linux.redhat

Post by CrayzeeWul » Tue, 15 Oct 2002 11:29:38



> Hi!All

> I am really sorry for this long mail, but it si urgent, so plz try ur best
> to help me asap.

Hi Prashant,

Your post has many things wrong with it. I am sure you will hear all about
it from the rest of the folks here. So, in the mean time you may want to
start reading the following to prepare:

http://www.tuxedo.org/~esr/faqs/smart-questions.html

> I have been trying to compile the socket.c program which i got from
> the usr/src/linux/net dictory in linux.



(a) This file is part of the kernel source code. You cannot expect to
compile it into an executable program.
(b) Never compile (or do anything that cannot be done) as root.
(c) Read your C book (do you see a "main()" in that file ?)
(d) Read your Linux book.

Quote:> (Can i compile socket.c
> individually?). If NO then how do i compile it.

(e) Read the kernel compilation documentation under
/usr/src/linux/Documentation and /usr/src/linux/README.

(f) Tell us what exactly are you trying to do here. Why do you want to
modify a file of the kernel source code ?

--
CrayzeeWulf

 
 
 

alt.linux, alt.os.linux, comp.os.linux.redhat

Post by mjt » Tue, 15 Oct 2002 12:25:48



> I am unable to understand what "unterminated #ifndef" signifies. I got
> these errors on compilation of only socket.c(Can i compile socket.c
> individually?).

... my suggestion is to get a good beginner's book on C programming,
such as, "C Primer Plus". if you have NO idea what an unterminated
#ifndef (or even what an #ifndef IS), then i suggest you stay away
from tying to modify source code/do rebuilds.  i'm being serious,
because if you muck up your system because you dont understand what
you're doing, then you might be in FAR more serious shape than
just an error message.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Michael J. Tobler: motorcyclist, surfer,  #    Black holes result
 skydiver, and author: "Inside Linux",     #   when God divides the  
 "C++ HowTo", "C++ Unleashed"              #     universe by zero

 
 
 

alt.linux, alt.os.linux, comp.os.linux.redhat

Post by Peter T. Breue » Tue, 15 Oct 2002 14:27:06



> I have been trying to compile the socket.c program which i got from
> the usr/src/linux/net dictory in linux. I am using RHL 7.3, but the

!! That's not a program! That's a kernel source file.

Stop banging your head with a mallet. It will hurt less.

> program gives the follwoing error:


THis will not work. It's not even a program. And you need flags like
-c, -O2, -D__KERNEL__, etc.

What are you trying to do?

Peter