include unistd.h in readwrite.h to declare read, write. #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
read(2) and write(2) are declared in unistd.h. Instead of redeclaring them in readwrite.h, include that system header to get the correct function signature.
This is the 1.08 portion of the read, write declaration cleanup. The 1.9 portion of this series is PR #43.
This change is necessary for -Wall -Werror, to prevent the following:
./compile qmail-local.c
In file included from exit.h:4:0,
from qmail-local.c:7:
/usr/include/unistd.h:363:16: error: conflicting types for ‘read’
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur;
^~~~
In file included from qmail-local.c:3:0:
readwrite.h:4:12: note: previous declaration of ‘read’ was here
extern int read();
^~~~
Which happens as a side-effect of PR #79, where we include unistd.h everywhere we include exit.h.