
- Forum
- Operating Systems
- Linux
- Unix---System Call
Unix---System Call
This is a discussion on Unix---System Call within the Linux forums, part of the Operating Systems category; Hello everybody, the below program is given for us in the class for practical........but i dint able to understand any ...
-
03-03-2010, 08:59 AM #1
- Join Date
- Feb 2010
- Answers
- 3
Unix---System Call
Hello everybody,
the below program is given for us in the class for practical........but i dint able to understand any single line........especially bolder and underlined texts
1...normally in we'll use #include<stdio.h> in c...where as in c++ ..#include<iostream.h>....but what this new header files>>>?
2....what is syntax..stands for ??bolder text area's
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
int main()
{
char buf[10];
char b[]="MASTER OF COMPUTER APPLICATION";
int fd;
if((fd=open("system.txt",O_RDWR|O_CREAT,S_IRUSR|S_IWUSR|S_IXUSR))>0)
printf("\n file opened \n");
printf("%d",fd);
if(write(fd,b,30)>0)
printf("\n written to the file");
if(lseek(fd,10,SEEK_SET)>0)
printf("\n cursor positioned \n");
if(read(fd,buf,8)>0)
printf("\n read success \n");
write(1,buf,8);
close(fd);
return(0);
}
~
-
01-16-2011, 10:32 PM #2
- Join Date
- Jan 2011
- Answers
- 14
The below program is given for us in the class for practical........but i dint able to understand any single line........especially bolder and underlined texts. 1...normally in we'll use #include in c...where as in c++ ..#include....but what this new header files>>>? 2....what is syntax..stands for ??bolder text area's. It is really amazing and outstanding.

Reply With Quote





