- Added basic support for dirent.h;
- Added memory.h for compatibility;
- Added ftruncate() function;
- Fixed date and time structures in ksys_file_info_t.

git-svn-id: svn://kolibrios.org@9954 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat
2024-01-12 23:01:16 +00:00
parent d91cb7946f
commit 6e3276cb4b
8 changed files with 175 additions and 24 deletions

View File

@@ -0,0 +1,24 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/ksys.h>
#include "glue.h"
#include "io.h"
int
_DEFUN (ftruncate, (fd, len),
int fd _AND
off_t len)
{
__io_handle *ioh;
if ((fd < 0) || (fd >=64))
{
errno = EBADF;
return (-1);
}
ioh = &__io_tab[fd];
if (_ksys_file_set_size(ioh->name, len))
return (-1);
return 0;
}