Using only the Unix input/output system calls(do not use any standard input/output functions), define two C functions, c

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Using only the Unix input/output system calls(do not use any standard input/output functions), define two C functions, c

Post by answerhappygod »

Using Only The Unix Input Output System Calls Do Not Use Any Standard Input Output Functions Define Two C Functions C 1
Using Only The Unix Input Output System Calls Do Not Use Any Standard Input Output Functions Define Two C Functions C 1 (196.67 KiB) Viewed 19 times
Using only the Unix input/output system calls(do not use any standard input/output functions), define two C functions, called myFgets() and myFputs() with the following requirements: • int myFgets(char *s, int size, int stream): reads in at most one less than size characters from stream (file descriptor is stream) and stores them into the buffer pointed to by s. Reading stops after an EOF or a newline (i.e., reading should be done one byte at a time). If a newline is read, it is stored into the buffer. A terminating null byte is stored after the last character in the buffer. This function returns the number of characters read or, 0 for end of file or -1 in case of error. int my Fputs(const char *s, int *stream), writes the string s to stream, without its terminating null byte. This function returns the number of characters written or -1 in case of error. Then, define your main function to perform a copy task using your defined functions, myFgets() and myF- puts(). Your C program takes two arguments, input file and destination file.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply