This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: ftruncate substitute
- From: Shaun Jackman <sjackman at gmail dot com>
- To: newlib at sources dot redhat dot com
- Date: Tue, 7 Dec 2004 10:33:43 -0800
- Subject: Re: ftruncate substitute
- References: <7f45d9390412061834481316c@mail.gmail.com>
- Reply-to: Shaun Jackman <sjackman at gmail dot com>
usleep is implemented in sys/linux/usleep.c, but not exported in
linux/sys/unistd.h. It is exported in include/sys/unistd.h armoured in
defined(__CYGWIN__) || defined(__rtems__). glibc exports it in
include/unistd.h armoured in defined __USE_BSD || defined
__USE_XOPEN_EXTENDED.
ftruncate is in the same position as usleep. It is defined as a system
call in sys/linux/io.c and exported in include/sys/unistd.h armoured
in defined(__CYGWIN__) || defined(__rtems__) || defined(__sh__). glibc
exports it in include/unistd.h armoured in defined __USE_BSD ||
defined __USE_XOPEN_EXTENDED.
Can these two declarations be added to linux/sys/unistd.h possibly
armoured in an ifdef, though I'm not sure which ifdef suits newlib
best.
Thanks,
Shaun
On Mon, 6 Dec 2004 18:34:52 -0800, Shaun Jackman <sjackman@gmail.com> wrote:
> I'm porting a glibc application to newlib. The application uses a
> couple functions not in newlib, ftruncate and usleep. For usleep I can
> substitue a call to nanosleep; although I'll probably just implement
> usleep using nanosleep. With what can I replace the ftruncate function
> call?
>
> Thanks,
> Shaun