revert of mass delete of the posix subsystem. perhaps there is hope for it yet.

svn path=/trunk/; revision=3674
This commit is contained in:
Rex Jolliff 2002-10-29 04:45:58 +00:00
parent c29a543da5
commit 385fdfdfeb
166 changed files with 20265 additions and 0 deletions

View file

@ -0,0 +1,22 @@
/* $Id: abort.c,v 1.4 2002/10/29 04:45:41 rex Exp $
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS POSIX+ Subsystem
* FILE: subsys/psx/lib/psxdll/stdlib/abort.c
* PURPOSE: Generate an abnormal process abort
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
* UPDATE HISTORY:
* 15/02/2002: Created
*/
#include <stdlib.h>
#include <signal.h>
void abort(void)
{
raise(SIGABRT);
}
/* EOF */

View file

@ -0,0 +1,51 @@
/* $Id: exit.c,v 1.4 2002/10/29 04:45:41 rex Exp $
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS POSIX+ Subsystem
* FILE: subsys/psx/lib/psxdll/stdlib/exit.c
* PURPOSE: Terminate a process
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
* UPDATE HISTORY:
* 27/12/2001: Created
*/
#include <ddk/ntddk.h>
#include <stdlib.h>
#include <psx/debug.h>
void exit(int status)
{
TODO("call all functions registered with atexit()");
TODO("flush all output streams, close all open streams");
TODO("remove all files created by tmpfile()");
TODO("close all of the file descriptors, directory streams, conversion \
descriptors and message catalogue descriptors");
TODO("send SIGCHILD to the parent process");
TODO("set parent pid of children to pid of psxss");
TODO("detach each attached shared-memory segment");
TODO("for each semaphore for which the calling process has set a semadj \
value(), add the value to the semval of the semaphore.");
TODO("if the process is a controlling process, send SIGHUP to each process \
in the foreground process group...");
TODO("... and disassociate the terminal from the session");
TODO("if the exit causes a process group to become orphaned, and if any \
member of the newly-orphaned process group is stopped, send SIGHUP and \
SIGCONT to each process in the newly-orphaned process group");
TODO("all open named semaphores in the calling process are closed");
TODO("remove any memory locks");
TODO("destroy memory mappings");
TODO("close all open message queue descriptors");
#if 0
ExitProcess(status);
#endif
NtTerminateProcess(NtCurrentProcess(), status);
}
/* EOF */

View file

@ -0,0 +1,55 @@
/* $Id: malloc.c,v 1.4 2002/10/29 04:45:41 rex Exp $
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS POSIX+ Subsystem
* FILE: subsys/psx/lib/psxdll/stdlib/malloc.c
* PURPOSE: Memory allocator
* PROGRAMMER: KJK::Hyperion <noog@libero.it>
* UPDATE HISTORY:
* 27/12/2001: Created
*/
#include <errno.h>
#include <psx/stdlib.h>
void * malloc(size_t size)
{
void * pTemp = __malloc(size);
if(!pTemp)
errno = ENOMEM;
return (pTemp);
}
void free(void * ptr)
{
__free(ptr);
}
void * calloc(size_t nelem, size_t elsize)
{
return (__malloc(nelem * elsize));
}
void * realloc(void * ptr, size_t size)
{
void * pTemp;
if(size == 0)
__free(ptr);
if(ptr == 0)
return __malloc(size);
pTemp = __realloc(ptr, size);
if(pTemp == 0)
errno = ENOMEM;
return (pTemp);
}
/* EOF */