[SOLVED] CS代考计算机代写 /* Child process of mmap-exit.

30 $

File Name: CS代考计算机代写_/*_Child_process_of_mmap-exit..zip
File Size: 508.68 KB

SKU: 8722917721 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


/* Child process of mmap-exit.
Mmaps a file and writes to it via the mmap’ing, then exits
without calling munmap.The data in the mapped region must be
written out at program termination. */

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

#define ACTUAL ((void *) 0x10000000)

void
test_main (void)
{
int handle;

CHECK (create (“sample.txt”, sizeof sample), “create ”sample.txt””);
CHECK ((handle = open (“sample.txt”)) > 1, “open ”sample.txt””);
CHECK (mmap (handle, ACTUAL) != MAP_FAILED, “mmap ”sample.txt””);
memcpy (ACTUAL, sample, sizeof sample);
}

Reviews

There are no reviews yet.

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

Shopping Cart
[SOLVED] CS代考计算机代写 /* Child process of mmap-exit.
30 $