From bce8535f50928bc1e5af6b9ce065a519489b0006 Mon Sep 17 00:00:00 2001 From: "KJK::Hyperion" Date: Fri, 17 May 2002 02:10:41 +0000 Subject: [PATCH] Started implementing sys/stat.h calls svn path=/trunk/; revision=2964 --- posix/lib/psxdll/sys/stat/chmod.c | 30 +++++++++++++++++++++++++ posix/lib/psxdll/sys/stat/mkdir.c | 34 ++++++++++++++++++++++++++++ posix/lib/psxdll/sys/stat/mkfifo.c | 24 ++++++++++++++++++++ posix/lib/psxdll/sys/stat/mknod.c | 23 +++++++++++++++++++ posix/lib/psxdll/sys/stat/stat.c | 36 ++++++++++++++++++++++++++++++ posix/lib/psxdll/sys/stat/umask.c | 24 ++++++++++++++++++++ 6 files changed, 171 insertions(+) create mode 100644 posix/lib/psxdll/sys/stat/chmod.c create mode 100644 posix/lib/psxdll/sys/stat/mkdir.c create mode 100644 posix/lib/psxdll/sys/stat/mkfifo.c create mode 100644 posix/lib/psxdll/sys/stat/mknod.c create mode 100644 posix/lib/psxdll/sys/stat/stat.c create mode 100644 posix/lib/psxdll/sys/stat/umask.c diff --git a/posix/lib/psxdll/sys/stat/chmod.c b/posix/lib/psxdll/sys/stat/chmod.c new file mode 100644 index 00000000000..deff306d45e --- /dev/null +++ b/posix/lib/psxdll/sys/stat/chmod.c @@ -0,0 +1,30 @@ +/* $Id: chmod.c,v 1.1 2002/05/17 02:10:41 hyperion Exp $ + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * FILE: subsys/psx/lib/psxdll/sys/stat/chmod.c + * PURPOSE: Change mode of a file + * PROGRAMMER: KJK::Hyperion + * UPDATE HISTORY: + * 15/05/2002: Created + */ + +#include +#include +#include + +int chmod(const char *path, mode_t mode) +{ + errno = ENOSYS; + return (-1); +} + +int fchmod(int fildes, mode_t mode) +{ + errno = ENOSYS; + return (-1); +} + +/* EOF */ + diff --git a/posix/lib/psxdll/sys/stat/mkdir.c b/posix/lib/psxdll/sys/stat/mkdir.c new file mode 100644 index 00000000000..d205dc9209b --- /dev/null +++ b/posix/lib/psxdll/sys/stat/mkdir.c @@ -0,0 +1,34 @@ +/* $Id: mkdir.c,v 1.1 2002/05/17 02:10:41 hyperion Exp $ + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * FILE: subsys/psx/lib/psxdll/sys/stat/mkdir.c + * PURPOSE: Make a directory + * PROGRAMMER: KJK::Hyperion + * UPDATE HISTORY: + * 15/05/2002: Created + */ + +#include +#include +#include +#include + +int mkdir(const char *path, mode_t mode) +{ + int nFileNo; + + switch((nFileNo = open(path, O_CREAT | O_EXCL | _O_DIRFILE, mode))) + { + case -1: + return (-1); + + default: + close(nFileNo); + return (0); + } +} + +/* EOF */ + diff --git a/posix/lib/psxdll/sys/stat/mkfifo.c b/posix/lib/psxdll/sys/stat/mkfifo.c new file mode 100644 index 00000000000..4eb0d02f1d3 --- /dev/null +++ b/posix/lib/psxdll/sys/stat/mkfifo.c @@ -0,0 +1,24 @@ +/* $Id: mkfifo.c,v 1.1 2002/05/17 02:10:41 hyperion Exp $ + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * FILE: subsys/psx/lib/psxdll/sys/stat/mkfifo.c + * PURPOSE: Make a FIFO special file + * PROGRAMMER: KJK::Hyperion + * UPDATE HISTORY: + * 15/05/2002: Created + */ + +#include +#include +#include + +int mkfifo(const char *path, mode_t mode) +{ + errno = ENOSYS; + return (-1); +} + +/* EOF */ + diff --git a/posix/lib/psxdll/sys/stat/mknod.c b/posix/lib/psxdll/sys/stat/mknod.c new file mode 100644 index 00000000000..29ed8217fbd --- /dev/null +++ b/posix/lib/psxdll/sys/stat/mknod.c @@ -0,0 +1,23 @@ +/* $Id: mknod.c,v 1.1 2002/05/17 02:10:41 hyperion Exp $ + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * FILE: subsys/psx/lib/psxdll/sys/stat/mknod.c + * PURPOSE: Make a directory, a special or regular file + * PROGRAMMER: KJK::Hyperion + * UPDATE HISTORY: + * 15/05/2002: Created + */ + +#include +#include + +int mknod(const char *path, mode_t mode, dev_t dev) +{ + errno = ENOSYS; + return (-1); +} + +/* EOF */ + diff --git a/posix/lib/psxdll/sys/stat/stat.c b/posix/lib/psxdll/sys/stat/stat.c new file mode 100644 index 00000000000..d9a8c8e25d5 --- /dev/null +++ b/posix/lib/psxdll/sys/stat/stat.c @@ -0,0 +1,36 @@ +/* $Id: stat.c,v 1.1 2002/05/17 02:10:41 hyperion Exp $ + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * FILE: subsys/psx/lib/psxdll/sys/stat/stat.c + * PURPOSE: Get file status + * PROGRAMMER: KJK::Hyperion + * UPDATE HISTORY: + * 15/05/2002: Created + */ + +#include +#include +#include + +int fstat(int fildes, struct stat *buf) +{ + errno = ENOSYS; + return (-1); +} + +int lstat(const char *path, struct stat *buf) +{ + errno = ENOSYS; + return (-1); +} + +int stat(const char *path, struct stat *buf) +{ + errno = ENOSYS; + return (-1); +} + +/* EOF */ + diff --git a/posix/lib/psxdll/sys/stat/umask.c b/posix/lib/psxdll/sys/stat/umask.c new file mode 100644 index 00000000000..11f51257a6a --- /dev/null +++ b/posix/lib/psxdll/sys/stat/umask.c @@ -0,0 +1,24 @@ +/* $Id: umask.c,v 1.1 2002/05/17 02:10:41 hyperion Exp $ + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS POSIX+ Subsystem + * FILE: subsys/psx/lib/psxdll/sys/stat/umask.c + * PURPOSE: + * PROGRAMMER: KJK::Hyperion + * UPDATE HISTORY: + * 15/05/2002: Created + */ + +#include +#include +#include + +mode_t umask(mode_t cmask) +{ + errno = ENOSYS; + return (-1); +} + +/* EOF */ + -- 2.17.1