473,512 Members | 15,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

very rusty non-C programmer needs help compiling

Hi,

I am trying to compile a C program that I found on the Internet; I want
to use it to spoof my hostid on a Linux box. The code is here:

http://cs1ajb.staff.shef.ac.uk/blog/...cdec4799a85512

When I try to compile, it gives me a syntax error and barfs.

The version of gcc I am using is 3.4.3 on a RHEL AS4-64bit system.

Please email me directly as I do not read Usenet often. I will post a
summary later.

TIA,

Steve
Nov 19 '06 #1
8 1249
Steven C. Liu wrote:
Hi,

I am trying to compile a C program that I found on the Internet; I want
to use it to spoof my hostid on a Linux box. The code is here:
Linux code questions are better directed to a Linux forum.
>
Please email me directly as I do not read Usenet often. I will post a
summary later.
That's not how Usenet works, you post here, you read here.

--
Ian Collins.
Nov 19 '06 #2
"Steven C. Liu" <sl**@steven-c-liu.comwrites:
I am trying to compile a C program that I found on the Internet; I
want to use it to spoof my hostid on a Linux box. The code is here:

http://cs1ajb.staff.shef.ac.uk/blog/...cdec4799a85512

When I try to compile, it gives me a syntax error and barfs.
That's because the code has a syntax error.
The declaration in question is:

static inline _syscall3
(int,real_ioctl,int,fd,unsigned int,cmd,unsigned long,arg);

I don't know what "_syscall3" is; it might be some compiler-specific
extension that's not supported by the compiler you're using.

The web page says to use gcc, and you're using a version of gcc.
Perhaps it's no longer supported. You might try asking in
gnu.gcc.help.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 19 '06 #3
You should probably post the error you're getting. It compiles fine on
GCC 4.04 on Debian 32 bit. I expect it is a 64 bit library issue.

Doug

On Sun, 19 Nov 2006 01:43:46 -0500
"Steven C. Liu" <sl**@steven-c-liu.comwrote:
Hi,

I am trying to compile a C program that I found on the Internet; I want
to use it to spoof my hostid on a Linux box. The code is here:

http://cs1ajb.staff.shef.ac.uk/blog/...cdec4799a85512

When I try to compile, it gives me a syntax error and barfs.

The version of gcc I am using is 3.4.3 on a RHEL AS4-64bit system.

Please email me directly as I do not read Usenet often. I will post a
summary later.

TIA,

Steve
---
For UNIX, Linux and security articles
visit http://SecurityBulletins.com/
Nov 19 '06 #4
Keith Thompson <ks***@mib.orgwrites:
[...]
I don't know what "_syscall3" is; it might be some compiler-specific
extension that's not supported by the compiler you're using.

The web page says to use gcc, and you're using a version of gcc.
Perhaps it's no longer supported. You might try asking in
gnu.gcc.help.
Or doing a Google search for _syscall3.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 19 '06 #5
"Steven C. Liu" wrote:
>
I am trying to compile a C program that I found on the Internet; I
want to use it to spoof my hostid on a Linux box. The code is here:

http://cs1ajb.staff.shef.ac.uk/blog/...cdec4799a85512

When I try to compile, it gives me a syntax error and barfs.

The version of gcc I am using is 3.4.3 on a RHEL AS4-64bit system.

Please email me directly as I do not read Usenet often. I will post
a summary later.
Of course. We are all anxious to go out and search for some
mysterious code, compile and debug it, with no clue as to what the
problem is. After that we can't wait to send email to some
unknown, who will use it for possibly nefarious purposes, such as
flogging our email addresses to spammers, and who is obviously too
lazy to read usenet. Our ambition is to serve and obey. [1]

On the other hand, you can always hire me at my standard rates to
do that. I suspect others are equally willing. Just be prepared
to pay for at least one days work in advance at approximately $100
per hour. Use certified checks, and wait for them to clear before
expecting any results.

[1] The Humanoids, by Jack Williamson, recently deceased.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

Nov 19 '06 #6
2006-11-19 <ln************@nuthaus.mib.org>,
Keith Thompson wrote:
That's because the code has a syntax error.
The declaration in question is:

static inline _syscall3
(int,real_ioctl,int,fd,unsigned int,cmd,unsigned long,arg);

I don't know what "_syscall3" is; it might be some compiler-specific
extension that's not supported by the compiler you're using.
If I remember linux/glibc correctly, it is a macro. And it is probably
not the source of his problem.
Nov 19 '06 #7
Thanks to those who responded constructively. I didn't see a syntax
mistake in the code, and I guess no one else here did either.

The error message is:

"fakeif.c:29: error: syntax error before 'real_ioctl'"

I'll check with a Linux or GCC newsgroup.

Steve

Doug Spencer wrote:
You should probably post the error you're getting. It compiles fine on
GCC 4.04 on Debian 32 bit. I expect it is a 64 bit library issue.

Doug

On Sun, 19 Nov 2006 01:43:46 -0500
"Steven C. Liu" <sl**@steven-c-liu.comwrote:
>Hi,

I am trying to compile a C program that I found on the Internet; I want
to use it to spoof my hostid on a Linux box. The code is here:

http://cs1ajb.staff.shef.ac.uk/blog/...cdec4799a85512

When I try to compile, it gives me a syntax error and barfs.

The version of gcc I am using is 3.4.3 on a RHEL AS4-64bit system.

Please email me directly as I do not read Usenet often. I will post a
summary later.

TIA,

Steve

---
For UNIX, Linux and security articles
visit http://SecurityBulletins.com/
Nov 19 '06 #8
Random832 <ra****@random.yi.orgwrites:
2006-11-19 <ln************@nuthaus.mib.org>,
Keith Thompson wrote:
>That's because the code has a syntax error.
The declaration in question is:

static inline _syscall3
(int,real_ioctl,int,fd,unsigned int,cmd,unsigned long,arg);

I don't know what "_syscall3" is; it might be some compiler-specific
extension that's not supported by the compiler you're using.

If I remember linux/glibc correctly, it is a macro. And it is probably
not the source of his problem.
Yes, it almost certainly is the source of the problem. When I
compiled the code myself, gcc reported a syntax error on that line.
The first hit on a Google search for "_syscall3" indicates that it
hasn't been supported since 2.6.17 (I think that's the version number
of the Linux kernel).

To the original poster: I suggest asking in a Linux programming
newsgroup. I don't hang out in the comp.os.linux.* and linux.*
hierarchies, so I don't know which would be best.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 19 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2396
by: C L Humphreys | last post by:
Hi, I'm used to programming with Java, and am unsure of how this may work within VB. I want to pass some strings to a function, and alter them within the function. I want the strings to stay...
3
1619
by: Sizer | last post by:
We make embedded devices that are basically wimpy linux boxes with small custom display/touchscreen heads on them. They're not running X or any other windowing system. All development is done with...
1
1513
by: Chris Todhunter | last post by:
Hi, I am responsible for a growing website. It is password protected and we collect data on everyone who logs in. Every month we produce a report on the trends of users which can result in some...
3
2299
by: ThunderMusic | last post by:
Hi, I'm trying to have a MSN Messenger like form/app closing behavior. When I click on the X button, I only want the form to disappear and when I double-click on the notify icon or right-click...
9
6264
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how...
3
1609
by: David Hearn | last post by:
I've been doing ASP.NET for the past few years and have gotten spoiled and now find myself in a situation where I need to make some changes to an old classic ASP page. The problem is that there is...
12
20612
by: John | last post by:
I can't get my head around this! I have the following code: <% .... Code for connection to the database ... .... Code for retrieving recordset ... If Not rs.EOF Then ... Do something...
46
6210
by: C C++ C++ | last post by:
what is an escaping variable?
23
1365
by: Raz | last post by:
On Wed, 30 Apr 2008 21:54:37 GMT, Erik Wikströ As I said, I will find the link again. His knowledge of C++ is just fine. ...
1
1616
by: Sam | last post by:
Hi there. I hope this code is standard C. I think it is. Anyway, I haven't used C in a Looooooong time and am a little rusty on pointers. I am wondering why "buff" is a pointer to a pointer...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.