/* Opens a directory, then tries to write to it, which must
fail. */
#include
#include tests/lib.h
#include tests/main.h
void
test_main (void)
{
int fd;
int retval;
CHECK (mkdir (xyzzy), mkdir xyzzy);
CHECK ((fd = open (xyzzy)) > 1, open xyzzy);
msg (write xyzzy);
retval = write (fd, foobar, 6);
CHECK (retval == -1,
write xyzzy (must return -1, actually %d), retval);
}

![[SOLVED] CS /* Opens a directory, then tries to write to it, which must](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[SOLVED] Naughty Receiver - Reliable Data Transfer](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.