From: Adrian Ho <aho-linux-asm@03s.net>
To: linux-assembly@vger.kernel.org
Subject: Re: chdir on linux does not work
Date: Thu, 25 May 2006 11:55:18 +0800 [thread overview]
Message-ID: <20060525035518.GA6288@megapower.03s.net> (raw)
In-Reply-To: <447401F4.4020603@comcast.net>
On Wed, May 24, 2006 at 02:49:24AM -0400, Frank Kotler wrote:
> Adding a call to sys_getcwd (__NR_ 183) (why is this man 3, not man 2
> ???)
Are you talking about sys_getcwd(3) (which I've never seen or known to
exist) or getcwd(3)? If the latter, there's a Linux-specific extension
that uses malloc() -- perhaps that's the reason why:
As an extension to the POSIX.1 standard, Linux (libc4, libc5, glibc)
getcwd() allocates the buffer dynamically using malloc() if buf is NULL
on call. In this case, the allocated buffer has the length size unless
size is zero, when buf is allocated as big as necessary. It is possi-
ble (and, indeed, advisable) to free() the buffers if they have been
obtained this way.
- Adrian
next prev parent reply other threads:[~2006-05-25 3:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 2:49 chdir on linux does not work Noprianto
2006-05-24 4:26 ` Timo Lindfors
2006-05-24 6:49 ` Frank Kotler
2006-05-24 7:15 ` Brian Raiter
2006-05-24 7:21 ` Frank Kotler
2006-05-24 12:17 ` Timo Lindfors
2006-05-25 3:55 ` Adrian Ho [this message]
2006-05-25 4:18 ` Frank Kotler
2006-05-24 6:18 ` Brian Raiter
2006-05-24 14:06 ` jeff
2006-05-25 3:20 ` Noprianto
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=20060525035518.GA6288@megapower.03s.net \
--to=aho-linux-asm@03s.net \
--cc=linux-assembly@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).