Problem 4 (dup versus dup2) Bookmark this page Where does YoHo Go? Suppose that file descriptor is connected to stdin, that file descriptor 1 is connected to the terminal screen, that file descriptor 2 is connected to stderr, that file descriptor 4 names a read connection from filel and that file descriptor 5 names a write connection to file1. Suppose that, in this situation, dup2 (2,5) is called. If write (5,"YoHo", 4); is then executed, where does YoHo go? To the terminal screen! ○ To filel! O Nowhere, 5 is now an unused file descriptor! Submit You have used 0 of 1 attempt Where does OhNo go? Suppose that file descriptor is connected to stdin, that file descriptor 1 is connected to the terminal screen, that file descriptor 2 is connected to stderr, that file descriptor 4 names a read connection from file1 and that file descriptor 5 names a write connection to file1. Suppose that, in this situation, dup (2) is called. If write (3,"OhNo", 4); is then called, where does OhNo go? To the terminal screen! O To filel! Save Nowhere, 3 is an unused file descriptor!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

This is referring to Linux and C Programming.

Problem 4 (dup versus dup2)
Bookmark this page
Where does YoHo Go?
Suppose that file descriptor is connected to stdin, that file descriptor 1 is connected to the terminal screen, that file
descriptor 2 is connected to stderr, that file descriptor 4 names a read connection from file1 and that file descriptor
5 names a write connection to file1.
Suppose that, in this situation, dup2 (2,5) is called.
If write (5, "YoHo", 4); is then executed, where does YoHo go?
To the terminal screen!
To file1!
Nowhere, 5 is now an unused file descriptor!
Submit You have used 0 of 1 attempt
Where does OhNo go?
Suppose that file descriptor is connected to stdin, that file descriptor 1 is connected to the terminal screen, that file
descriptor 2 is connected to stderr, that file descriptor 4 names a read connection from filel and that file descriptor
5 names a write connection to file1.
Suppose that, in this situation, dup (2) is called.
If write (3,"OhNo", 4); is then called, where does OhNo go?
To the terminal screen!
To filel!
Save
Nowhere, 3 is an unused file descriptor!
Transcribed Image Text:Problem 4 (dup versus dup2) Bookmark this page Where does YoHo Go? Suppose that file descriptor is connected to stdin, that file descriptor 1 is connected to the terminal screen, that file descriptor 2 is connected to stderr, that file descriptor 4 names a read connection from file1 and that file descriptor 5 names a write connection to file1. Suppose that, in this situation, dup2 (2,5) is called. If write (5, "YoHo", 4); is then executed, where does YoHo go? To the terminal screen! To file1! Nowhere, 5 is now an unused file descriptor! Submit You have used 0 of 1 attempt Where does OhNo go? Suppose that file descriptor is connected to stdin, that file descriptor 1 is connected to the terminal screen, that file descriptor 2 is connected to stderr, that file descriptor 4 names a read connection from filel and that file descriptor 5 names a write connection to file1. Suppose that, in this situation, dup (2) is called. If write (3,"OhNo", 4); is then called, where does OhNo go? To the terminal screen! To filel! Save Nowhere, 3 is an unused file descriptor!
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Memory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education