diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2004-07-11 10:01:41 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2004-07-11 10:01:41 +0000 |
commit | 1b0314715b397d6d11bf3b1eb7efdff41e5adab4 (patch) | |
tree | 155aa0b4471207a8ade8adc322e6281812b3a63d /winsup/mingw | |
parent | 8261a23149ab0c47715e31392ea512480233c4bf (diff) | |
download | newlib-1b0314715b397d6d11bf3b1eb7efdff41e5adab4.zip newlib-1b0314715b397d6d11bf3b1eb7efdff41e5adab4.tar.gz newlib-1b0314715b397d6d11bf3b1eb7efdff41e5adab4.tar.bz2 |
* include/unistd.h (ftruncate): Add inline definition.
* mingwex/ftruncate.c: New file.
* mingwex/Makefile.in: Add ftruncate.o to libmingwex.a.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 10 | ||||
-rw-r--r-- | winsup/mingw/include/unistd.h | 16 | ||||
-rw-r--r-- | winsup/mingw/mingwex/Makefile.in | 6 | ||||
-rwxr-xr-x | winsup/mingw/mingwex/ftruncate.c | 5 |
4 files changed, 32 insertions, 5 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 5cd1369..0d10394 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,8 +1,14 @@ -2004-07-10 Danny Smith <dannysmith@users.sourceforge.net> +2004-07-11 Danny Smith <dannysmith@users.sourceforge.net> + + * include/unistd.h (ftruncate): Add inline definition. + * mingwex/ftruncate.c: New file. + * mingwex/Makefile.in: Add ftruncate.o to libmingwex.a. + +2004-07-10 Danny Smith <dannysmith@users.sourceforge.net> * include/time.h: Do not include sys/types.h. -2004-07-02 Danny Smith <dannysmith@users.sourceforge.net> +2004-07-02 Danny Smith <dannysmith@users.sourceforge.net> * mingwex/Makefile.in (MATH_DISTFILES): Remove pow.c, (MATH_OBJS): Remove pow,o. diff --git a/winsup/mingw/include/unistd.h b/winsup/mingw/include/unistd.h index 37682e5..f3a5449 100644 --- a/winsup/mingw/include/unistd.h +++ b/winsup/mingw/include/unistd.h @@ -14,4 +14,20 @@ #include <getopt.h> #undef __UNISTD_GETOPT__ +#ifdef __cplusplus +extern "C" { +#endif + +/* This is defined as a real library function to allow autoconf + to verify its existence. */ +int ftruncate(int, off_t); +__CRT_INLINE int ftruncate(int __fd, off_t __length) +{ + return _chsize (__fd, __length); +} + +#ifdef __cplusplus +} +#endif + #endif /* _UNISTD_H */ diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in index 6853ca3..1369de6 100644 --- a/winsup/mingw/mingwex/Makefile.in +++ b/winsup/mingw/mingwex/Makefile.in @@ -29,8 +29,8 @@ DISTFILES = Makefile.in configure configure.in \ _Exit.c atoll.c dirent.c feclearexcept.c fegetenv.c \ fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \ fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \ - feupdateenv.c fwide.c getopt.c imaxabs.c imaxdiv.c ldtoa.c \ - lltoa.c lltow.c mbsinit.c mingw-fseek.c sitest.c strtof.c \ + feupdateenv.c ftruncate.c fwide.c getopt.c imaxabs.c imaxdiv.c \ + ldtoa.c lltoa.c lltow.c mbsinit.c mingw-fseek.c sitest.c strtof.c \ strtoimax.c strtold.c strtoumax.c testwmem.c ulltoa.c ulltow.c \ wcstof.c wcstoimax.c wcstold.c wcstoumax.c wdirent.c wmemchr.c \ wmemcmp.c wmemcpy.c wmemmove.c wmemset.c wtoll.c @@ -147,7 +147,7 @@ FENV_OBJS = fesetround.o fegetround.o \ feclearexcept.o feholdexcept.o fegetexceptflag.o \ feraiseexcept.o fetestexcept.o fesetexceptflag.o POSIX_OBJS = \ - dirent.o wdirent.o getopt.o + dirent.o wdirent.o getopt.o ftruncate.o REPLACE_OBJS = \ mingw-fseek.o COMPLEX_OBJS = \ diff --git a/winsup/mingw/mingwex/ftruncate.c b/winsup/mingw/mingwex/ftruncate.c new file mode 100755 index 0000000..fdb6295 --- /dev/null +++ b/winsup/mingw/mingwex/ftruncate.c @@ -0,0 +1,5 @@ +#include <unistd.h> +int ftruncate(int __fd, off_t __length) +{ + return _chsize (__fd, __length); +} |