Changeset 2915
- Timestamp:
- Dec 27, 2006, 10:20:14 PM (19 years ago)
- Location:
- trunk/libc
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/include/InnoTekLIBC/libc.h
r1618 r2915 1 /* $Id$ */ 2 /** @file 3 * 4 * Global LIBC stuff. 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net> 7 * 8 * 9 * This file is part of InnoTek LIBC. 10 * 11 * InnoTek LIBC is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * InnoTek LIBC is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with InnoTek LIBC; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * 25 */ 26 27 #ifndef __InnoTekLIBC_libc_h__ 28 #define __InnoTekLIBC_libc_h__ 29 30 #include <sys/cdefs.h> 31 #include <sys/signal.h> 32 33 __BEGIN_DECLS 34 35 /** Disable (some) unix imitation features. 36 * 37 * If non-zero, '\\' is prefered over '/', and a bunch of other unix 38 * imitations are dropped. 39 * 40 * Initiated by __init_dll(). 41 */ 42 extern int __libc_gfNoUnix; 43 44 /** Signal set of the signals which will interrupt system call execution. 45 * By default all signals will interrupt syscall execution, since OS/2 can't really 46 * restart system calls easily. 47 * Update is protected by the signal semaphore, however read access isn't. 48 */ 49 extern sigset_t __libc_gSignalRestartMask; 50 51 __END_DECLS 52 53 #endif 1 /* dead */ -
trunk/libc/include/klibc/initterm.h
r2901 r2915 31 31 32 32 # include <stdint.h> 33 # include <emx/startup.h> 33 34 34 35 __BEGIN_DECLS -
trunk/libc/include/klibc/os2/os2.h
r2914 r2915 40 40 #include <os2thunk.h> 41 41 42 #ifndef HFILE_STDERR 43 # define HFILE_STDERR 2 42 44 #endif 43 45 46 #ifndef HFILE_STDOUT 47 # define HFILE_STDOUT 1 48 #endif 49 50 #ifndef HFILE_STDIN 51 # define HFILE_STDIN 0 52 #endif 53 54 55 #endif 56 -
trunk/libc/include/sys/signal.h
r2305 r2915 541 541 542 542 /******************************************************************************* 543 * Global Variables * 544 *******************************************************************************/ 545 #if __BSD_VISIBLE 546 /** Signal set of the signals which will interrupt system call execution. 547 * By default all signals will interrupt syscall execution, since OS/2 can't really 548 * restart system calls easily. 549 * Update is protected by the signal semaphore, however read access isn't. 550 */ 551 extern sigset_t __libc_gSignalRestartMask; 552 #endif 553 554 555 /******************************************************************************* 543 556 * Functions * 544 557 *******************************************************************************/ -
trunk/libc/src/kNIX/Makefile.kmk
r2914 r2915 33 33 34 34 libc_kNIX_TEMPLATE = libcsub 35 libc_kNIX_INCS = $(PATH_LIBC_SRC)/kNIX 35 36 libc_kNIX_SOURCES = \ 36 37 $(PATH_LIBC_SRC)/kNIX/b_fsPathResolve.c \ … … 150 151 $(PATH_LIBC_SRC)/kNIX/os2/logstrict.c \ 151 152 $(PATH_LIBC_SRC)/kNIX/os2/os2error.c \ 152 $(PATH_LIBC_SRC)/kNIX/os2/p2t.c \153 153 $(PATH_LIBC_SRC)/kNIX/os2/pathrewrite.c \ 154 154 $(PATH_LIBC_SRC)/kNIX/os2/priority.c \ … … 208 208 LIBRARIES += libc_kNIX_asm 209 209 libc_kNIX_asm_TEMPLATE = libcsubasm 210 libc_kNIX_asm_INCS = $(PATH_LIBC_SRC)/kNIX 210 211 libc_kNIX_asm_SOURCES.os2 = \ 211 212 $(PATH_LIBC_SRC)/kNIX/os2/386/signal16bit.asm -
trunk/libc/src/kNIX/kNIX.h
r2914 r2915 41 41 #endif 42 42 #include <errno.h> 43 #include <io.h> 43 44 #include <malloc.h> 44 45 #include <share.h> … … 46 47 #include <string.h> 47 48 #include <process.h> 49 #include <setjmp.h> 48 50 #include <sys/builtin.h> 49 51 #include <sys/dirent.h> … … 116 118 typedef __LIBC_FHDIR *__LIBC_PFHDIR; 117 119 118 int __libc_Back_dirOpenNative(char *pszNativePath, unsigned fInUnixTree, unsigned fLibc, struct stat *pStat );120 int __libc_Back_dirOpenNative(char *pszNativePath, unsigned fInUnixTree, unsigned fLibc, struct stat *pStat, __LIBC_PPFH ppFH); 119 121 int __libc_back_dirInherit(int fh, const char *pszNativePath, unsigned fInUnixTree, unsigned fFlags, 120 122 ino_t Inode, dev_t Dev, unsigned uCurEntry); -
trunk/libc/src/kNIX/os2/b_dir.c
r2909 r2915 30 30 #include "kNIX.h" 31 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_IO 32 #include < InnoTekLIBC/logstrict.h>32 #include <klibc/logstrict.h> 33 33 34 34 … … 419 419 420 420 if (rc > 0) 421 rc = -__libc_ native2errno(rc);421 rc = -__libc_back_native2errno(rc); 422 422 return rc; 423 423 } … … 480 480 * @param fLibc The LIBC open() flags. 481 481 * @param pStat Pointer to the stat structure for the directory. 482 */ 483 int __libc_Back_dirOpenNative(char *pszNativePath, unsigned fInUnixTree, unsigned fLibc, struct stat *pStat) 484 { 485 LIBCLOG_ENTER("pszNativePath=%p:{%s} fInUnixTree=%d fLibc=%#x pStat=%p\n", (void *)pszNativePath, pszNativePath, fInUnixTree, fLibc, (void *)pStat); 482 * @param ppFH 483 */ 484 int __libc_Back_dirOpenNative(char *pszNativePath, unsigned fInUnixTree, unsigned fLibc, struct stat *pStat, __LIBC_PPFH ppFH) 485 { 486 LIBCLOG_ENTER("pszNativePath=%p:{%s} fInUnixTree=%d fLibc=%#x pStat=%p ppFH=%p\n", (void *)pszNativePath, pszNativePath, fInUnixTree, fLibc, (void *)pStat, (void *)ppFH); 486 487 487 488 /* … … 516 517 pFHDir->Core.Dev = pStat->st_dev; 517 518 pFHDir->fInUnixTree = fInUnixTree; 518 519 519 LIBCLOG_MSG("pFHDir=%p:{.hDir=%#lx, .fType=%d, .cFiles=%ld, .cbBuf=%#x} fh=%d\n", 520 520 (void *)pFHDir, pFHDir->hDir, pFHDir->fType, pFHDir->cFiles, pFHDir->cbBuf, fh); 521 if (ppFH) 522 *ppFH = &pFHDir->Core; 523 else 524 __libc_FHPut(&pFHDir->Core); 521 525 LIBCLOG_RETURN_INT(fh); 522 526 } 523 527 LIBCLOG_ERROR_RETURN_INT(rc); 524 528 } 525 526 529 527 530 … … 573 576 /** @todo verify that ERROR_NO_MORE_FILES is returned repeatedly. */ 574 577 if (!cbRet && rc != ERROR_NO_MORE_FILES) 575 cbRet = -__libc_ native2errno(rc);578 cbRet = -__libc_back_native2errno(rc); 576 579 pFHDir->cFiles = 0; 577 580 break; -
trunk/libc/src/kNIX/os2/b_ioFileControl.c
r2914 r2915 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 32 #define INCL_ERRORS 33 #define INCL_FSMACROS 34 #include <os2emx.h> 35 36 #include <fcntl.h> 37 #include <errno.h> 38 #include <limits.h> 39 #include <io.h> 40 #include <string.h> 41 #include <sys/builtin.h> 42 #include "b_fs.h" 43 #include <InnoTekLIBC/backend.h> 44 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_IO 45 #include <InnoTekLIBC/logstrict.h> 30 #include "kNIX.h" 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_IO 32 #include <klibc/logstrict.h> 46 33 47 34 … … 76 63 */ 77 64 __LIBC_PFH pFH; 78 int rc = __libc_FH Ex(fh, &pFH);65 int rc = __libc_FHGet(fh, &pFH); 79 66 if (!rc) 80 67 { … … 92 79 * Non-standard fh - call registered method. 93 80 */ 94 rc = pFH->pOps->pfnFileControl(pFH, fh, iRequest, (int)iArg, prc); /** @todo fix iArg */ 95 } 81 rc = pFH->pOps->pfnFileControl(pFH, iRequest, (int)iArg, prc); /** @todo fix iArg */ 82 } 83 __libc_FHPut(pFH); 96 84 if (!rc) 97 85 LIBCLOG_RETURN_INT(rc); -
trunk/libc/src/kNIX/os2/b_ioFileOpen.c
r2914 r2915 177 177 { 178 178 /** @todo add ppFH to the argument list of __libc_Back_dirOpenNative() */ 179 rc = __libc_Back_dirOpenNative(szNativePath, fInUnixTree, fLibc, &st); 180 if (rc >= 0) 181 { 182 if (ppFH) 183 __libc_FHGet(rc, ppFH); 184 LIBCLOG_RETURN_INT(rc); 185 } 186 LIBCLOG_ERROR_RETURN_INT(rc); 187 break; 179 rc = __libc_Back_dirOpenNative(szNativePath, fInUnixTree, fLibc, &st, ppFH); 180 LIBCLOG_MIX_RETURN_INT(rc); 188 181 } 189 182 -
trunk/libc/src/kNIX/os2/b_processExit.c
r2742 r2915 1 /* sys/exit.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes 2 Copyright (c) 2004 knut st. osmundsen */ 1 /* $Id: $ */ 2 /** @file 3 * 4 * kNIX - _Exit(). 5 * 6 * Copyright (c) 1992-1993 by Eberhard Mattes 7 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 8 * 9 * 10 * This file is part of kLIBC. 11 * 12 * kLIBC is free software; you can redistribute it and/or modify 13 * it under the terms of the GNU Lesser General Public License as published 14 * by the Free Software Foundation; either version 2 of the License, or 15 * (at your option) any later version. 16 * 17 * kLIBC is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU Lesser General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public License 23 * along with kLIBC; if not, write to the Free Software 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 * 26 */ 3 27 4 #include "libc-alias.h" 5 #define INCL_FSMACROS 6 #include <os2emx.h> 7 #include <emx/syscalls.h> 8 #include <InnoTekLIBC/sharedpm.h> 9 /******************************************************************************* 10 * Structures and Typedefs * 11 *******************************************************************************/ 28 #include "kNIX.h" 12 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_INITTERM 13 #include < InnoTekLIBC/logstrict.h>30 #include <klibc/logstrict.h> 14 31 15 16 void __exit(int rc) 32 /** 33 * Sets the exit code for the current process and terminates it. 34 * This call never returns. 35 * 36 * @param rc The process exit code. 37 */ 38 void __libc_Back_processExit(int rc) 17 39 { 18 40 LIBCLOG_ENTER("rc=%d\n", rc); … … 28 50 */ 29 51 FS_SAVE_LOAD(); 30 for (;;) 31 DosExit(EXIT_PROCESS, rc < 0 || rc > 255 ? 255 : rc); 52 rc = rc < 0 || rc > 255 ? 255 : rc; 53 DosExit(EXIT_PROCESS, rc); 54 __libc_Back_panic(__LIBC_PANIC_NO_SPM_TERM, NULL, "DosExit() returned\n"); 32 55 LIBCLOG_MSG("shut up\n"); 33 56 } 57 -
trunk/libc/src/kNIX/os2/b_processGetPriority.c
r2913 r2915 2 2 /** @file 3 3 * 4 * kNIX - getpriority() .4 * kNIX - getpriority(), OS/2. 5 5 * 6 * Copyright (c) 2005 knut st. osmundsen <bird@anduin.net>6 * Copyright (c) 2005-2006 knut st. osmundsen <bird@anduin.net> 7 7 * 8 8 * … … 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #include "priority.h" 32 #include <sys/time.h> 33 #include <sys/resource.h> 34 #include <errno.h> 35 #include <InnoTekLIBC/backend.h> 36 #include <InnoTekLIBC/sharedpm.h> 37 #include <klibc/fib.h> 30 #include "kNIX.h" 38 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_PROCESS 39 #include < InnoTekLIBC/logstrict.h>32 #include <klibc/logstrict.h> 40 33 41 34 -
trunk/libc/src/kNIX/os2/b_processSetPriority.c
r2914 r2915 2 2 /** @file 3 3 * 4 * kNIX - setpriority() .4 * kNIX - setpriority(), OS/2. 5 5 * 6 6 * Copyright (c) 2005 knut st. osmundsen <bird@anduin.net> … … 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #include "priority.h" 32 #include "backend.h" 33 #include <sys/time.h> 34 #include <sys/resource.h> 35 #include <errno.h> 36 #include <InnoTekLIBC/backend.h> 37 #include <InnoTekLIBC/sharedpm.h> 30 #include "kNIX.h" 38 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_PROCESS 39 #include <InnoTekLIBC/logstrict.h> 40 41 #define INCL_DOSPROCESS 42 #define INCL_FSMACROS 43 #define INCL_ERRORS 44 #include <os2emx.h> 32 #include <klibc/logstrict.h> 45 33 46 34 -
trunk/libc/src/kNIX/os2/b_processWait.c
r2914 r2915 30 30 * Header Files * 31 31 *******************************************************************************/ 32 #define INCL_BASE 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 37 #include <sys/wait.h> 38 #include <errno.h> 39 #include <string.h> 40 #include <386/builtin.h> 41 #include <sys/fmutex.h> 42 #include "backend.h" 43 #include "b_process.h" 44 #include "b_signal.h" 45 #include <emx/startup.h> 46 #include <emx/umalloc.h> 47 #include <InnoTekLIBC/libc.h> 48 #include <InnoTekLIBC/thread.h> 49 #include <InnoTekLIBC/sharedpm.h> 50 #include <InnoTekLIBC/backend.h> 51 #include <InnoTekLIBC/FastInfoBlocks.h> 52 #include <InnoTekLIBC/fork.h> 32 #include "kNIX.h" 33 #include <klibc/initterm.h> 53 34 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_PROCESS 54 #include < InnoTekLIBC/logstrict.h>35 #include <klibc/logstrict.h> 55 36 56 37 -
trunk/libc/src/kNIX/os2/b_signalInterrupt.c
r2913 r2915 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #include <signal.h> 33 #include <errno.h> 34 #include <InnoTekLIBC/backend.h> 27 #include "kNIX.h" 35 28 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 36 #include <InnoTekLIBC/logstrict.h> 37 #include "b_signal.h" 38 29 #include <klibc/logstrict.h> 39 30 40 31 /** -
trunk/libc/src/kNIX/os2/b_signalMask.c
r2913 r2915 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #define INCL_BASE 33 #define INCL_FSMACROS 34 #define INCL_DOSSIGNALS 35 #include <os2emx.h> 36 37 #include <signal.h> 38 #include <errno.h> 39 #include <InnoTekLIBC/thread.h> 40 #include <InnoTekLIBC/backend.h> 27 #include "kNIX.h" 41 28 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 42 #include <InnoTekLIBC/logstrict.h> 43 #include "b_signal.h" 44 29 #include <klibc/logstrict.h> 45 30 46 31 /** -
trunk/libc/src/kNIX/os2/b_signalPending.c
r2913 r2915 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #include <signal.h> 33 #include <errno.h> 34 #include <InnoTekLIBC/thread.h> 35 #include <InnoTekLIBC/backend.h> 27 #include "kNIX.h" 36 28 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 37 #include <InnoTekLIBC/logstrict.h> 38 #include "b_signal.h" 39 29 #include <klibc/logstrict.h> 40 30 41 31 /** … … 81 71 } 82 72 83 -
trunk/libc/src/kNIX/os2/b_signalQueue.c
r2913 r2915 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #include <signal.h> 33 #include <errno.h> 34 #include <InnoTekLIBC/backend.h> 27 #include "kNIX.h" 35 28 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 36 #include <InnoTekLIBC/logstrict.h> 37 #include "b_signal.h" 38 #include "syscalls.h" 39 40 29 #include <klibc/logstrict.h> 41 30 42 31 /** … … 68 57 SigInfo.si_value = SigVal; 69 58 int rc; 70 if (pid == _sys_pid)59 if (pid == fibGetPid()) 71 60 { 72 61 if (iSignalNo) -
trunk/libc/src/kNIX/os2/b_signalStack.c
r2913 r2915 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #include <signal.h> 33 #include <errno.h> 34 #include <InnoTekLIBC/thread.h> 35 #include <InnoTekLIBC/backend.h> 31 #include "kNIX.h" 36 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 37 #include <InnoTekLIBC/logstrict.h> 38 #include "b_signal.h" 33 #include <klibc/logstrict.h> 39 34 40 35 /** -
trunk/libc/src/kNIX/os2/b_signalSuspend.c
r2913 r2915 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #include <signal.h> 33 #include <errno.h> 34 #include <InnoTekLIBC/thread.h> 35 #include <InnoTekLIBC/backend.h> 31 #include "kNIX.h" 36 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 37 #include <InnoTekLIBC/logstrict.h> 38 #include "b_signal.h" 33 #include <klibc/logstrict.h> 39 34 40 35 -
trunk/libc/src/kNIX/os2/kNIX-os2.h
r2914 r2915 29 29 30 30 #include <InnoTekLIBC/sharedpm.h> 31 #include "os2/dosex.h" 32 31 33 32 34 __BEGIN_DECLS … … 246 248 void __libc_back_processWaitNotifyChild(siginfo_t *pSigInfo); 247 249 void __libc_back_processWaitNotifyNoWait(int fNoWaitStatus); 250 extern _fmutex __libc_gmtxExec; 248 251 249 252 -
trunk/libc/src/kNIX/os2/libcfork.c
r2914 r2915 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #define NO_EXAPIS_MAPPINGS 33 #define INCL_BASE 34 #define INCL_FSMACROS 35 #define INCL_FPCWMACROS 36 #define INCL_EXAPIS 37 #define INCL_ERRORS 38 #define INCL_DOSINFOSEG 39 #include <os2emx.h> 40 #include <stdlib.h> 41 #include <stddef.h> 42 #include <string.h> 43 #include <errno.h> 44 #include <setjmp.h> 45 #include <emx/syscalls.h> 46 #include <386/builtin.h> 47 #include <sys/fmutex.h> 48 #include <InnoTekLIBC/fork.h> 49 #include <InnoTekLIBC/sharedpm.h> 50 #include <InnoTekLIBC/FastInfoBlocks.h> 51 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_FORK 52 #include <InnoTekLIBC/logstrict.h> 53 #include "syscalls.h" 54 #include "DosEx.h" 55 #include "b_process.h" 31 #include "kNIX.h" 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_FORK 33 #include <klibc/logstrict.h> 56 34 57 35 -
trunk/libc/src/kNIX/os2/logstrict.c
r2913 r2915 49 49 * Header Files * 50 50 *******************************************************************************/ 51 #define _GNU_SOURCE /* strnlen() */ 52 #include <InnoTekLIBC/logstrict.h> 53 #include <string.h> 54 #include <stdio.h> 55 #include <stdlib.h> 56 #include <stdarg.h> 57 #include <process.h> 58 #include <errno.h> 59 #include <sys/builtin.h> 60 #include <emx/umalloc.h> 61 #include <setjmp.h> 62 #include <machine/param.h> 63 #include <InnoTekLIBC/thread.h> 64 #include <InnoTekLIBC/fork.h> 65 66 #define INCL_BASE 67 #define INCL_FSMACROS 68 #include <os2.h> 69 #ifndef HFILE_STDERR 70 #define HFILE_STDERR 2 71 #endif 51 #include "kNIX.h" 52 #include <klibc/logstrict.h> 72 53 73 54
Note:
See TracChangeset
for help on using the changeset viewer.