You are on page 1of 1

:

int open(char *name, int mode [ , int permissions ] );


int creat(char *name, int permissions);
int close(int fd);
void exit(int status);
int read(int fd, void *buf, int size);
int write(int fd, void *buf, int size);
off_t lseek(int fd, off_t offset, int whence);
Access mode flags: O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT,
O_TRUNC
:
int i=13;
write(fd,&i,sizeof(int));
read(fd,&i,sizeof(int));
:
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main (int argc, char *argv[]) //argc (argument count) argv (argument vector)
{
return 0;
}
:
cse12345@ainex:~ $ gcc -o myprog myprog.c
argc argv :
argc: 4
argv[0]: gcc
argv[1]: -o
argv[2]: myprog
argv[3]: myprog.c

You might also like