Skip to content

Commit

Permalink
Add chp3-FileIO
Browse files Browse the repository at this point in the history
  • Loading branch information
manatee authored and manatee committed Mar 29, 2020
1 parent 595c2c5 commit ff9b9f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apue.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Our own header, to be included before all standard system headers */
#include "error.c"

#ifndef _APUE_H
#define _APUE_H

Expand All @@ -22,7 +22,7 @@
#include <string.h> /* for convenience */
#include <unistd.h> /* for convenience */
#include <signal.h> /* for SIG_ERR */

#include "error.c"
#define MAXLINE 4096 /* max line length */

/*
Expand Down
Binary file added chp3-FileIO/seekFile
Binary file not shown.
16 changes: 16 additions & 0 deletions chp3-FileIO/seekFile.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int main()
{
if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1)
printf("Can not seek\n");
else
{
printf("Seek ok\n");
}

exit(0);

}

0 comments on commit ff9b9f5

Please sign in to comment.