Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

explain plz 2.26 (only) 2.23 How are iOS and Android similar? How are they diffe

ID: 3886077 • Letter: E

Question

explain plz 2.26 (only)


2.23 How are iOS and Android similar? How are they different? 224 Explain why Java programs running on Android systems do not use the standard Java API and virtual machine. The experimental Synthesis operating system has an assembler incor- porated in the kernel. To optimize system-call performance, the kernel assembles routines within kernel space to minimize the path that the system call must take through the kernel. This approach is the antithesis of the layered approach, in which the path through the kernel is extended to make building the operating system easier. Discuss the pros and cons of the Synthesis approach to kernel design and system-performance optimization. 2.25 gramming Problems 2.26 In Section 2.3, we described a program that copies the contents of one file to a destination file. This program works by first prompting the user for the name of the source and destination files. Write this program using either the Windows or POSIX API. Be sure to include all necessary error checking, including ensuring that the source file exists. Once you have correctly designed and tested the program, if you used a system that supports it, run the program using a utility that traces system calls. Linux systems provide the strace utility, and Solaris and Mac OS X systems use the dtrace command. As Windows systems do not provide such features, you will have to trace through the Windows version of this program using a debugger rogramming Projects Linux Kernel Modules In this project, you will learn how to create a kernel module and load it into the Linux kernel. The project can be completed using the Linux virtual machine

Explanation / Answer

The Answer For your Qurestion is given below

Explanation:

The Input file will be containing the string Welcome and This Input string Welcome will be copied to the buffer in our code and our aim is achieved by using open and read POSIX's API and for copying the data we used buffer

Code:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define BLOCK_SIZE 4096
int main()
{
int sds=-1; //variable declaration
ssize_t read_bytes=-1;
int i=0; //variable declaration
char buffers[50]; //variable declaration
sds=open("./file-to-buffers.txt",O_RDONLY);
if(-1 == sds)
{
perror("Open Failed");
return 1;
}

while((read_bytes=read(sds,buffers,BLOCK_SIZE))>0)
{
printf("the no of read_bytes=%d ",read_bytes);
}

while(buffers[i]!='')
{
printf("buffers[%d]=%d ",i,buffers[i]); //Testing forcharacters read from the file to buffer.The file contains "Welcome"
i++;
//buffers[5]= -How?
}
//buffers[6]=``-How?
close(sds);
return 0;
}

Sample Output:

the no of read_bytes=7

buffers[0]=w

buffers[1]=e

buffers[2]=l

buffers[3]=c

buffers[4]=o

buffers[5]=m

buffers[6]=e

buffers[7]=

Hope This HElps, if you have any doubts please comment i will get back to you