fork download
  1. #include<stdio.h>
  2.  
  3. #include <unistd.h>
  4.  
  5. #include<fcntl.h>
  6. #include<unistd.h>
  7.  
  8. int main(){
  9.  
  10. int fd=0;
  11.  
  12. static char buf[20];
  13. fd = open("amazon", O_RDWR);
  14. read(fd, buf, 5);
  15. lseek(fd, 3, SEEK_SET);
  16.  
  17. printf("%s\n", buf);
  18.  
  19. read(fd, buf, 6);
  20. printf("%s\n", buf);
  21. }
Success #stdin #stdout 0s 5552KB
stdin
Standard input is empty
stdout