linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Advanced Programming in the Unix Environment [Stevens]
@ 2002-08-30 15:04 Ibraheem Umaru-Mohammed
  2002-08-30 18:53 ` Glynn Clements
  0 siblings, 1 reply; 4+ messages in thread
From: Ibraheem Umaru-Mohammed @ 2002-08-30 15:04 UTC (permalink / raw)
  To: linux-c-programming

So, I was going through some of the exercises in the said book. Came
across Exercise 3.2, which states the following:

    ,----[ Exercise 3.2 ]
    | Write your own function called dup2 that performs the same service
    | as the dup2 function we described in Section 3.12, without calling
    | the fcntl function. Be sure to handle errors correctly.
    `----

Is there some sort of function that I don't know of that opens a file on a 
specified file descriptor? If not, am not seeing how this can be done,
since open returns the lowest available file descriptor - that is we
can't specify the second argument to dup2 to an open function. I noticed
fdopen(), but that associates a stream with an *existing* file
descriptor. Can someone help [1] ?

Kindest regards,

				--ibz.

[1] - The answer is not at the back of the book. :(

-- 
				Ibraheem Umaru-Mohammed 
					"ibz"
			umarumohammed (at) btinternet (dot) com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-08-31  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-30 15:04 Advanced Programming in the Unix Environment [Stevens] Ibraheem Umaru-Mohammed
2002-08-30 18:53 ` Glynn Clements
2002-08-30 21:35   ` Ibraheem Umaru-Mohammed
2002-08-31  0:00     ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).