[SOLVED] CS代考计算机代写 /* Verifies that memory mappings persist after file close. */

30 $

File Name: CS代考计算机代写_/*_Verifies_that_memory_mappings_persist_after_file_close._*/.zip
File Size: 800.7 KB

SKU: 2392150951 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


/* Verifies that memory mappings persist after file close. */

#include
#include
#include “tests/vm/sample.inc”
#include “tests/arc4.h”
#include “tests/lib.h”
#include “tests/main.h”

#define ACTUAL ((void *) 0x10000000)

void
test_main (void)
{
int handle;
mapid_t map;

CHECK ((handle = open (“sample.txt”)) > 1, “open ”sample.txt””);
CHECK ((map = mmap (handle, ACTUAL)) != MAP_FAILED, “mmap ”sample.txt””);

close (handle);

if (memcmp (ACTUAL, sample, strlen (sample)))
fail (“read of mmap’d file reported bad data”);

munmap (map);
}

Reviews

There are no reviews yet.

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

Shopping Cart
[SOLVED] CS代考计算机代写 /* Verifies that memory mappings persist after file close. */
30 $