/contrib/sdk/sources/newlib/libc/sys/_rename.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/sys/stat.c.bak |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/sys/access.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/sys/open.c |
---|
128,6 → 128,8 |
buildpath(buf, filename); |
} |
// printf("%s %s\n", __FUNCTION__, buf); |
err = get_fileinfo(buf, &info); |
if( flags & O_EXCL && |
187,6 → 189,8 |
ioh->read = read_file; |
ioh->write = write_file; |
// printf("%s %s\n", __FUNCTION__, ioh->name); |
return hid; |
}; |
/contrib/sdk/sources/newlib/libc/sys/stat.c |
---|
13,10 → 13,7 |
* they apply. |
*/ |
#include <sys/stat.h> |
#include <sys/kos_io.h> |
#include <errno.h> |
#include <time.h> |
#include <string.h> |
#include "glue.h" |
/* |
27,68 → 24,7 |
const char *path _AND |
struct stat *buf) |
{ |
fileinfo_t info; |
struct tm time; |
if( get_fileinfo(path, &info)) |
{ |
errno = ENOENT; |
errno = EIO; |
return (-1); |
}; |
memset (buf, 0, sizeof (* buf)); |
buf->st_size = info.size; |
if (info.attr & 0x10) |
buf->st_mode = S_IFDIR; |
else |
{ |
if (info.attr & 0x07) |
buf->st_mode = S_IFREG|S_IRUSR|S_IXUSR; |
else |
buf->st_mode = S_IFREG|S_IRUSR|S_IWUSR|S_IXUSR; |
} |
buf->st_blksize = 4096; |
time.tm_sec = info.atime.sec; |
time.tm_min = info.atime.min; |
time.tm_hour = info.atime.hour; |
time.tm_mday = info.adate.day; |
time.tm_mon = info.adate.month; |
time.tm_year = info.adate.year - 1900; |
time.tm_isdst = -1; |
buf->st_atime = mktime(&time); |
time.tm_sec = info.ctime.sec; |
time.tm_min = info.ctime.min; |
time.tm_hour = info.ctime.hour; |
time.tm_mday = info.cdate.day; |
time.tm_mon = info.cdate.month; |
time.tm_year = info.cdate.year - 1900; |
time.tm_isdst = -1; |
buf->st_ctime = mktime(&time); |
time.tm_sec = info.mtime.sec; |
time.tm_min = info.mtime.min; |
time.tm_hour = info.mtime.hour; |
time.tm_mday = info.mdate.day; |
time.tm_mon = info.mdate.month; |
time.tm_year = info.mdate.year - 1900; |
time.tm_isdst = -1; |
buf->st_mtime = mktime(&time); |
return (0); |
} |
int |
_DEFUN (lstat, (path, buf), |
const char *path _AND |
struct stat *buf) |
{ |
return stat(path, buf); |
} |
/contrib/sdk/sources/newlib/libc/sys/fstat.c |
---|
26,8 → 26,6 |
struct stat *buf) |
{ |
fileinfo_t info; |
struct tm time; |
__io_handle *ioh; |
if( (fd < 0) || (fd >=64) ) |
49,44 → 47,9 |
ioh = &__io_tab[fd]; |
get_fileinfo(ioh->name, &info); |
if (info.attr & 0x10) |
buf->st_mode = S_IFDIR; |
else |
{ |
if (info.attr & 0x07) |
buf->st_mode = S_IFREG|S_IRUSR|S_IXUSR; |
else |
buf->st_mode = S_IFREG|S_IRUSR|S_IWUSR|S_IXUSR; |
} |
buf->st_mode = S_IFREG; |
buf->st_blksize = 4096; |
time.tm_sec = info.atime.sec; |
time.tm_min = info.atime.min; |
time.tm_hour = info.atime.hour; |
time.tm_mday = info.adate.day; |
time.tm_mon = info.adate.month; |
time.tm_year = info.adate.year - 1900; |
time.tm_isdst = -1; |
buf->st_atime = mktime(&time); |
time.tm_sec = info.ctime.sec; |
time.tm_min = info.ctime.min; |
time.tm_hour = info.ctime.hour; |
time.tm_mday = info.cdate.day; |
time.tm_mon = info.cdate.month; |
time.tm_year = info.cdate.year - 1900; |
time.tm_isdst = -1; |
buf->st_ctime = mktime(&time); |
time.tm_sec = info.mtime.sec; |
time.tm_min = info.mtime.min; |
time.tm_hour = info.mtime.hour; |
time.tm_mday = info.mdate.day; |
time.tm_mon = info.mdate.month; |
time.tm_year = info.mdate.year - 1900; |
time.tm_isdst = -1; |
buf->st_mtime = mktime(&time); |
buf->st_size = info.size; |
}; |
return (0); |
/contrib/sdk/sources/newlib/libc/sys/unlink.c |
---|
19,47 → 19,15 |
#include "glue.h" |
static int delete_file(const char *path) |
{ |
int retval; |
__asm__ __volatile__ ( |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"movl %1, 1(%%esp) \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"pushl $8 \n\t" |
"movl %%esp, %%ebx \n\t" |
"movl $70, %%eax \n\t" |
"int $0x40 \n\t" |
"addl $28, %%esp \n\t" |
:"=a" (retval) |
:"r" (path) |
:"ebx"); |
return retval; |
}; |
/* |
* unlink -- since we have no file system, |
* we just return an error. |
*/ |
int |
_DEFUN (unlink, (path), |
char * path) |
{ |
int err; |
printf("%s %s\n", __FUNCTION__, path); |
err = delete_file(path); |
if (!err) |
return 0; |
if (err == 5) |
errno = ENOENT; |
else |
errno = EIO; |
return (-1); |
} |
/contrib/sdk/sources/newlib/libc/sys/create.c |
---|
8,7 → 8,7 |
__asm__ __volatile__ ( |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"movl %1, 1(%%esp) \n\t" |
"movl %0, 1(%%esp) \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
/contrib/sdk/sources/newlib/libc/sys/delete.c |
---|
0,0 → 1,26 |
#include <sys/types.h> |
#include <sys/kos_io.h> |
int delete_file(const char *path) |
{ |
int retval; |
__asm__ __volatile__ ( |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"movl %0, 1(%%esp) \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"pushl $0 \n\t" |
"pushl $8 \n\t" |
"movl %%esp, %%ebx \n\t" |
"movl $70, %%eax \n\t" |
"int $0x40 \n\t" |
"addl $28, %%esp \n\t" |
:"=a" (retval) |
:"r" (path) |
:"ebx"); |
return retval; |
}; |
/contrib/sdk/sources/newlib/libc/Makefile |
---|
15,7 → 15,7 |
NAME:= libc |
DEFINES:= -D_IEEE_LIBM -DHAVE_RENAME |
DEFINES:= -D_IEEE_LIBM |
INCLUDES:= -I $(LIBC_INCLUDES) |
97,29 → 97,27 |
locale/locale.c \ |
locale/lctype.c \ |
locale/ldpart.c \ |
reent/closer.c \ |
reent/fstatr.c \ |
reent/impure.c \ |
reent/init_reent.c \ |
reent/getreent.c \ |
reent/mutex.c \ |
reent/gettimeofdayr.c \ |
reent/impure.c \ |
reent/init_reent.c \ |
reent/isattyr.c \ |
reent/openr.c \ |
reent/closer.c \ |
reent/linkr.c \ |
reent/readr.c \ |
reent/lseekr.c \ |
reent/mutex.c \ |
reent/openr.c \ |
reent/readr.c \ |
reent/renamer.c \ |
reent/statr.c \ |
reent/fstatr.c \ |
reent/writer.c \ |
reent/timesr.c \ |
reent/unlinkr.c \ |
reent/writer.c \ |
search/qsort.c \ |
search/bsearch.c \ |
signal/signal.c \ |
sys/access.c \ |
sys/close.c \ |
sys/create.c \ |
sys/delete.c \ |
sys/errno.c \ |
sys/finfo.c \ |
sys/fsize.c \ |
132,7 → 130,6 |
sys/lseek.c \ |
sys/open.c \ |
sys/read.c \ |
sys/_rename.c \ |
sys/stat.c \ |
sys/unlink.c \ |
sys/write.c \ |
270,13 → 267,11 |
fwrite.c \ |
fvwrite.c \ |
fwalk.c \ |
mktemp.c \ |
putc.c \ |
puts.c \ |
refill.c \ |
rget.c \ |
remove.c \ |
rename.c \ |
rewind.c \ |
setvbuf.c \ |
stdio.c \ |
/contrib/sdk/sources/newlib/libc/stdio/mktemp.c |
---|
File deleted |
/contrib/sdk/sources/newlib/libc/reent/statr.c |
---|
File deleted |