Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
4
Добавлен:
26.05.2014
Размер:
402 б
Скачать
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define SEGSIZE 80
#define CHAN "tstchnl"
#define str "test string"

main()
{
int fd;
int n;
char buff[SEGSIZE];
fd = open(CHAN, O_RDWR);
printf("Writing...\n");
while ((n = read(fd,buff,SEGSIZE)) > 0)
write(fd,str,n);
printf("Reading...\n");
read(fd,buff,SEGSIZE);
write(1,buff,strlen(buff));
close(fd);
exit(0);
 }

Соседние файлы в папке AKAM
  • #
    26.05.20141.35 Кб44.c
  • #
    26.05.2014402 б44a.c
  • #
    26.05.201411.37 Кб5a.out