473,686 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

compile C programs with UNIX system calls (= Unix Programs??)

If the C programs have UNIX system calls such as fork(), alarm(),
etc.., we should call it UNIX programs, not traditional C programs?

We couldn't compile the programs with system calls using VC++ compiler.
I need to compile it under UNIX platform. correct? any other
alternatives??

Please advise. Thanks!!

Jul 22 '05 #1
12 3434
On Mon, 3 Jan 2005 jr********@hotm ail.com wrote:
If the C programs have UNIX system calls such as fork(), alarm(),
etc.., we should call it UNIX programs, not traditional C programs?
WHo calls them C programs? Personally, I'd call the UNIX programs.
We couldn't compile the programs with system calls using VC++ compiler.
What do you expect? Windoze programs that compile fine on VC++
probably won't work on UNIX...
I need to compile it under UNIX platform. correct? any other
alternatives??


I don't understand the question. If you're targeting a certain platform,
then of course you need to compile on it. Trying to run (say) a program
that was compiled on Windoze on Solaris will get you nowhere: you need to
compile to program on Solaris if that is what you're targeting.

--
Rich Teer, SCNA, SCSA, author of "Solaris Systems Programming"

. * * . * .* .
. * . .*
President, * . . /\ ( . . *
Rite Online Inc. . . / .\ . * .
.*. / * \ . .
. /* o \ .
Voice: +1 (250) 979-1638 * '''||''' .
URL: http://www.rite-online.net *************** ***
Jul 22 '05 #2
On Tue, 04 Jan 2005 03:18:18 GMT, Rich Teer
<ri*******@ri te-group.com> wrote:
On Mon, 3 Jan 2005 jr********@hotm ail.com wrote:
If the C programs have UNIX system calls such as fork(), alarm(),
etc.., we should call it UNIX programs, not traditional C programs?
WHo calls them C programs? Personally, I'd call the UNIX programs.


If they are written in C they are C programs, whatever libraries they
happen to use. Calling them "UNIX programs" helps no one, since a "UNIX
program" could be written in any language from raw binary to COBOL.
We couldn't compile the programs with system calls using VC++ compiler.


What do you expect? Windoze programs that compile fine on VC++
probably won't work on UNIX...


Many won't, many will (if they have been written portably).
I need to compile it under UNIX platform. correct? any other
alternatives??


I don't understand the question. If you're targeting a certain platform,
then of course you need to compile on it.


Never heard of a cross-compiler? I would be really stuck if I had to
compile my programs on the target platform, mobile phones usually don't
support compilers...
Trying to run (say) a program
that was compiled on Windoze on Solaris
You mean "targetted for Windoze".
will get you nowhere: you need to
compile to program on Solaris if that is what you're targeting.


Or use a cross-compiler which targets Solaris. I have one, gcc running
under Cygwin on Windoze targetting a Sparc machine (and others
targetting ARM, M68000 and other platforms).

Chris C

(Note followups)
Jul 22 '05 #3
In article <sl************ ******@ccserver .keris.net>,
Chris Croughton <ch***@keristor .net> wrote:
On Tue, 04 Jan 2005 03:18:18 GMT, Rich Teer
<ri*******@ri te-group.com> wrote:
On Mon, 3 Jan 2005 jr********@hotm ail.com wrote:
If the C programs have UNIX system calls such as fork(), alarm(),
etc.., we should call it UNIX programs, not traditional C programs?


WHo calls them C programs? Personally, I'd call the UNIX programs.


If they are written in C they are C programs, whatever libraries they
happen to use. Calling them "UNIX programs" helps no one, since a "UNIX
program" could be written in any language from raw binary to COBOL.


(Reading and posting from comp.unix.shell - keep that in mind)

This, incidentally, is *not* the view held in the (curiously named)
newsgroup "comp.lang. c".

They maintain that system-specific stuff, be it:

socket(foo,bar, blaz);

or

lpStr LpHand EXPORT WinPlaceWin(a,b ,c);

is, plain and simply, not C.

Of course, what it is, they won't say...

Jul 22 '05 #4
ga*****@yin.int eraccess.com (Kenny McCormack) writes:
In article <sl************ ******@ccserver .keris.net>,
Chris Croughton <ch***@keristor .net> wrote:
On Tue, 04 Jan 2005 03:18:18 GMT, Rich Teer
<ri*******@ri te-group.com> wrote:
On Mon, 3 Jan 2005 jr********@hotm ail.com wrote:

If the C programs have UNIX system calls such as fork(), alarm(),
etc.., we should call it UNIX programs, not traditional C programs?

WHo calls them C programs? Personally, I'd call the UNIX programs.


If they are written in C they are C programs, whatever libraries they
happen to use. Calling them "UNIX programs" helps no one, since a "UNIX
program" could be written in any language from raw binary to COBOL.


(Reading and posting from comp.unix.shell - keep that in mind)

This, incidentally, is *not* the view held in the (curiously named)
newsgroup "comp.lang. c".

They maintain that system-specific stuff, be it:

socket(foo,bar, blaz);

or

lpStr LpHand EXPORT WinPlaceWin(a,b ,c);

is, plain and simply, not C.

Of course, what it is, they won't say...


The first appears to be a BSD/SysV system call.
The second is an abomination.
Jul 22 '05 #5
Kenny McCormack wrote:
In article <sl************ ******@ccserver .keris.net>,
Chris Croughton <ch***@keristor .net> wrote:
On Tue, 04 Jan 2005 03:18:18 GMT, Rich Teer
<ri*******@ri te-group.com> wrote:

On Mon, 3 Jan 2005 jr********@hotm ail.com wrote:
If the C programs have UNIX system calls such as fork(), alarm(),
etc.., we should call it UNIX programs, not traditional C programs?

WHo calls them C programs? Personally, I'd call the UNIX programs.


If they are written in C they are C programs, whatever libraries they
happen to use. Calling them "UNIX programs" helps no one, since a "UNIX
program" could be written in any language from raw binary to COBOL.

(Reading and posting from comp.unix.shell - keep that in mind)

This, incidentally, is *not* the view held in the (curiously named)
newsgroup "comp.lang. c".

They maintain that system-specific stuff, be it:

socket(foo,bar, blaz);

or

lpStr LpHand EXPORT WinPlaceWin(a,b ,c);

is, plain and simply, not C.

Of course, what it is, they won't say...


Sure they will. They'll say it is off-topic for a group which is
dedicated only to discussing the C language, and they'll flame ya for
daring to discuss an obviously OT issue...

JFC (BTDT)

Jul 22 '05 #6
In article <9kxCd.37080$F2 5.23808@okeprea d07>,
J. F. Cornwall <JC*******@cox. net> wrote:
Kenny McCormack wrote:
In article <sl************ ******@ccserver .keris.net>,
Chris Croughton <ch***@keristor .net> wrote:
On Tue, 04 Jan 2005 03:18:18 GMT, Rich Teer
<ri*******@ri te-group.com> wrote:
On Mon, 3 Jan 2005 jr********@hotm ail.com wrote:
>If the C programs have UNIX system calls such as fork(), alarm(),
>etc.., we should call it UNIX programs, not traditional C programs?

WHo calls them C programs? Personally, I'd call the UNIX programs.

If they are written in C they are C programs, whatever libraries they
happen to use. Calling them "UNIX programs" helps no one, since a "UNIX
program" could be written in any language from raw binary to COBOL.

(Reading and posting from comp.unix.shell - keep that in mind)

This, incidentally, is *not* the view held in the (curiously named)
newsgroup "comp.lang. c".

They maintain that system-specific stuff, be it:

socket(foo,bar, blaz);

or

lpStr LpHand EXPORT WinPlaceWin(a,b ,c);

is, plain and simply, not C.

Of course, what it is, they won't say...


Sure they will. They'll say it is off-topic for a group which is
dedicated only to discussing the C language, and they'll flame ya for
daring to discuss an obviously OT issue...

JFC (BTDT)


Best case, yes.

But the truly catholic view is that it is not C. And, in some obscure
sense, this is right. I.e., a function call is not really part of the
C language - it is an invocation of some externally (*) authored
functionality.

(*) Interpret this term loosely. It matters not to this discussion whether
external means any or all of:
1) By someone else
2) By a system implementor (i.e., system libraries)
3) By you, perhaps even in this same source file.

Or whether the target of that function call is written in C or any other
language.

Jul 22 '05 #7

"Kenny McCormack" <ga*****@yin.in teraccess.com> wrote in message
news:cr******** **@yin.interacc ess.com...

<snip>
They maintain that system-specific stuff, be it:

socket(foo,bar, blaz);

or

lpStr LpHand EXPORT WinPlaceWin(a,b ,c);

is, plain and simply, not C.
It (probably) is. But then again, so is an implementation of TicTacToe. So
you suggest any question on TicTacToe should be topical aswell?
Of course, what it is, they won't say...


The *language* C is on topic, not the possible implementations of all kinds
of things in that language. If that restriction would not be there, almost
*anything* would be on topic and the quality of the ng would suffer.

An ng on the english language would not consider a review of the match
Wolverhampton Wanderers - Tottenham Hotspur on topic, would they?

Check out:
http://benpfaff.org/writings/clc/off-topic.html
http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
Jul 22 '05 #8
Dan Espen <da****@spam.mk .telcordia.com> scribbled the following
on comp.lang.c:
ga*****@yin.int eraccess.com (Kenny McCormack) writes:
This, incidentally, is *not* the view held in the (curiously named)
newsgroup "comp.lang. c".
"Curiously named"? It's named comp.lang.c because it discusses C, not
operating systems. If you want comp.unix.progr ammer or the
comp.os.ms-windows.program mer hierarchy, you know where to find them.
They maintain that system-specific stuff, be it:

socket(foo,bar, blaz);

or

lpStr LpHand EXPORT WinPlaceWin(a,b ,c);

is, plain and simply, not C.

Of course, what it is, they won't say...
The first appears to be a BSD/SysV system call.
The second is an abomination.


That makes no difference as far as C is concerned. Both are equally
off-topic

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"We're women. We've got double standards to live up to."
- Ally McBeal
Jul 22 '05 #9

Kenny McCormack wrote:
In article <sl************ ******@ccserver .keris.net>,
Chris Croughton <ch***@keristor .net> wrote:
On Tue, 04 Jan 2005 03:18:18 GMT, Rich Teer
<ri*******@ri te-group.com> wrote:
On Mon, 3 Jan 2005 jr********@hotm ail.com wrote:

If the C programs have UNIX system calls such as fork(), alarm(),
etc.., we should call it UNIX programs, not traditional C programs?
WHo calls them C programs? Personally, I'd call the UNIX
programs.
If they are written in C they are C programs, whatever libraries theyhappen to use. Calling them "UNIX programs" helps no one, since a "UNIXprogram" could be written in any language from raw binary to COBOL.
(Reading and posting from comp.unix.shell - keep that in mind)

This, incidentally, is *not* the view held in the (curiously named)
newsgroup "comp.lang. c".


Curiously?
They maintain that system-specific stuff, be it:

socket(foo,bar, blaz);

or

lpStr LpHand EXPORT WinPlaceWin(a,b ,c);

is, plain and simply, not C.

It is not part of the standard C prgramming language, which is what
comp.lang.c discusses, hence the name "comp.lang. c". You will not find
the keywords lpStr, LpHand, or EXPORT described by the C Language
Standard, nor will you find either WinPlaceWin() or socket() in the
standard C library.

Specific implementations of the language are outside the scope of
comp.lang.c. Wanna know how declarators work, or why i=i++ isn't
well-defined, or why gets() is evil and should never be used, then
comp.lang.c is the place to go. Wanna know how to open a socket, or
send a file to a printer, or play a .wmv file, then you need to go
someplace else, because those issues have nothing to do with the C
language itself. Of course, what it is, they won't say...


ISO/IEC 9899:1999.

Jul 22 '05 #10

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

Similar topics

10
4453
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering the table definitions, all of which seems to work OK, I entered a tiny 8-row table and can do...
3
16741
by: Abby | last post by:
I'm now using Cygwin as my compiler for C code. I use Dev-c++ as my editor. The reason why I chose Cygwin compiler instead of the compiler that came with Dev-C++ is that I believe it uses the same environment as in Linux, so that I don't have to write different sourcecode for both OS. Eventhough, I don't understand about Linux much, and I'm still a beginner in programming, I still have to make my program compatible with both OS (Windows...
17
9208
by: hugo27 | last post by:
hugo27 July 13, 2004 > >The teachy books and documentation I've read do not >mention the Escape key, but everytime I hit it during >runtime my programs go bananas. > >This relates to a larger issue, namely, what is >standard C good for? Of what use is it? >We have the null set: each person writes and >uses their own progams. This works to a degree, but
5
3536
by: markus | last post by:
Hi, I have a question that deals with the standard c library VS (Unix) system calls. The question is: which header files (and functions) are part of the C library and which header files (and function calls) are part of the (Unix) system calls. The cause of my confusion is that for example stdio.h is considered
18
488
by: jrefactors | last post by:
If the C programs have UNIX system calls such as fork(), alarm(), etc.., we should call it UNIX programs, not traditional C programs? We couldn't compile the programs with system calls using VC++ compiler. I need to compile it under UNIX platform. correct? any other alternatives?? Please advise. Thanks!!
36
3637
by: lovecreatesbeauty | last post by:
In the C programming language, I/O operation functions are declared in stdio.h, for example, fopen(), fclose(), fwrite(), fread(), fseek() ... But another set of I/O functions are also defined in Unix, for example, open(), close(), read(), write(), lseek() ... Which set of functions is more suitable for I/O task, C library version or Unix version? Thank you
2
1555
by: parag_paul | last post by:
I have been seeing a consistent slowness in g++ compilation for a small file like the following , The uptime is near ( load Is near to 0 ) . I have put the time output for the same, The file looks like the following #include<iostream> #include<vector> #include<deque> using namespace std;
0
3295
by: dot | last post by:
I spent a few headache filled days trying to use GMP on windows (XP pro) I finally got it to work and since I found little help on the Web I thought someone might find what i did useful. Creating an environment suitable for GMP programming. 1) Create 'cygwin' environment (see below) 2)add GMP to the cygwin directory (see below)
35
4579
by: jleslie48 | last post by:
I've written a cgi program in C using the borland 5.5 free compiler, and it runs just fine on an Apache server. My only issue is if I issue some system calls the cgi suspends until the call finishes. for example if in my c program I have a line: system("notepad"); I can see with the taskmanager that an instance of notepad.exe is
0
8586
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8520
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8772
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7603
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.