From: Ibraheem Umaru-Mohammed <iumarumo@eidosnet.co.uk>
To: linux-c-programming@vger.kernel.org
Subject: Advanced Programming in the Unix Environment [Stevens]
Date: Fri, 30 Aug 2002 16:04:51 +0100 [thread overview]
Message-ID: <20020830150451.GK25019@micromuse.com> (raw)
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
next reply other threads:[~2002-08-30 15:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-30 15:04 Ibraheem Umaru-Mohammed [this message]
2002-08-30 18:53 ` Advanced Programming in the Unix Environment [Stevens] Glynn Clements
2002-08-30 21:35 ` Ibraheem Umaru-Mohammed
2002-08-31 0:00 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020830150451.GK25019@micromuse.com \
--to=iumarumo@eidosnet.co.uk \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).