84d9c625bf
- Fix for possible unset uid/gid in toproto - Fix for default mtree style - Update libelf - Importing libexecinfo - Resynchronize GCC, mpc, gmp, mpfr - build.sh: Replace params with show-params. This has been done as the make target has been renamed in the same way, while a new target named params has been added. This new target generates a file containing all the parameters, instead of printing it on the console. - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org) get getservbyport() out of the inner loop Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
51 lines
1 KiB
C
51 lines
1 KiB
C
#include <sys/cdefs.h>
|
|
#include "namespace.h"
|
|
#include <lib.h>
|
|
|
|
#include <sys/stat.h>
|
|
#include <string.h>
|
|
|
|
#ifdef __weak_alias
|
|
__weak_alias(_stat, __stat50);
|
|
__weak_alias(_lstat, __lstat50);
|
|
__weak_alias(_fstat, __fstat50);
|
|
|
|
__weak_alias(stat, __stat50);
|
|
__weak_alias(lstat, __lstat50);
|
|
__weak_alias(fstat, __fstat50);
|
|
#endif
|
|
|
|
int stat(const char *name, struct stat *buffer)
|
|
{
|
|
message m;
|
|
|
|
memset(&m, 0, sizeof(m));
|
|
m.VFS_STAT_LEN = strlen(name) + 1;
|
|
m.VFS_STAT_NAME = (char *) __UNCONST(name);
|
|
m.VFS_STAT_BUF = (char *) buffer;
|
|
|
|
return _syscall(VFS_PROC_NR, VFS_STAT, &m);
|
|
}
|
|
|
|
int fstat(int fd, struct stat *buffer)
|
|
{
|
|
message m;
|
|
|
|
memset(&m, 0, sizeof(m));
|
|
m.VFS_FSTAT_FD = fd;
|
|
m.VFS_FSTAT_BUF = (char *) buffer;
|
|
|
|
return _syscall(VFS_PROC_NR, VFS_FSTAT, &m);
|
|
}
|
|
|
|
int lstat(const char *name, struct stat *buffer)
|
|
{
|
|
message m;
|
|
|
|
memset(&m, 0, sizeof(m));
|
|
m.VFS_STAT_LEN = strlen(name) + 1;
|
|
m.VFS_STAT_NAME = (char *) __UNCONST(name);
|
|
m.VFS_STAT_BUF = (char *) buffer;
|
|
|
|
return _syscall(VFS_PROC_NR, VFS_LSTAT, &m);
|
|
}
|