#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <errno.h>
$1
main() {
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
if (fd < 0) exit(1);
if (pwrite(fd, "text", 4, 0) != 4) exit(1);
/* Linux glibc breakage until 2.2.5 */
- if (pwrite(fd, "text", 4, -1) != -1) exit(1);
+ if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
exit(0);
}
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <errno.h>
$1
main() {
char buf[3];
if (fd < 0) exit(1);
if (pread(fd, buf, 2, 0) != 2) exit(1);
/* Linux glibc breakage until 2.2.5 */
- if (pread(fd, buf, 2, -1) != -1) exit(1);
+ if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
exit(0);
}
],[