[SOLVED] CS代考计算机代写 /* Opens a directory, then tries to write to it, which must

30 $

File Name: CS代考计算机代写_/*_Opens_a_directory,_then_tries_to_write_to_it,_which_must.zip
File Size: 781.86 KB

SKU: 6451910956 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


/* 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);
}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考计算机代写 /* Opens a directory, then tries to write to it, which must
30 $