473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

System calls in Unix

2
Hello one and all,

I need to implement a system calls using C++ in Unix, I really hope someone outhere can help me....

The task is to implement the following system call:
-create a file
-open file
-close
-write
-read
-and exit

my first problem is I don't have Unix, so how do I do to implement the system with my current windows, without installing Unix..

I'm a beginner...

any help are appreciated...thanks

jml
Sep 4 '06 #1
2 2694
Banfa
9,065 Expert Mod 8TB
You should be able to write a program that does that in a portable way. That is write it on Windows so that the code will easily recompile on UNIX.

Write a console program with a main entry point

Use only standard C functions (or C++ classes)

For file IO I suggest the functions

fopen
fread
fwrite
fputs
fprintf
fclose

I suggest you look these up.
Sep 4 '06 #2
jml06
2
Thanks for your suggestion....

But I not very simillar with the codes...

I will look these up....

but how about if I use fstream....can it run on Unix....
example: ifstream infile;
string filename="abc.txt";
infile.open(filename.c_str(),ios::in);


and what is the different for using C in windows and unix?....
Sep 4 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: igthibau | last post by:
Hello one and all, Hopefully someone can help me out here. I am trying within a C / C++ program to invoke command line instructions (under linux) i.e.: say I wish to list the contents of the...
12
by: Gil | last post by:
I am running a C++ process on Solaris that needs to find out how much diskspace is free and used on the system. Is 'system' in stdlib.h the only way to make OS calls from C++? In this case,...
12
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++...
5
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...
22
by: markus | last post by:
Hi, There are more than 1000 defined system calls in the Unix standard specification, however, a majority of them are optional and the availability of system calls are dependent on the OS...
7
by: rahul8143 | last post by:
hello, what is difference between system call and library function call? Does library function call can have context switch to kernel mode? regards, rahul
21
by: omkar pangarkar | last post by:
Hi all, I have two simple hello world programs one using printf() and other using write() --prog 1-- #include<stdio.h> #include<stdlib.h> int main() { printf("Hello"); /* up to here...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.