Changeset 2916
- Timestamp:
- Dec 28, 2006, 5:14:47 AM (19 years ago)
- Location:
- trunk/libc
- Files:
-
- 1 deleted
- 51 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/include/InnoTekLIBC/pathrewrite.h
r2021 r2916 1 /* $Id$ */ 2 /** @file 3 * 4 * InnoTek LIBC - Path Rewrite. 5 * 6 * Copyright (c) 2004-2005 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 Lesser General Public License as published 13 * by 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 Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser 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 28 #ifndef __libc_InnoTekLIBC_pathrewrite_h__ 29 #define __libc_InnoTekLIBC_pathrewrite_h__ 30 /** @group __libc_PathReWrite 31 * @{ */ 32 33 /******************************************************************************* 34 * Header Files * 35 *******************************************************************************/ 36 #include <sys/cdefs.h> 37 38 39 /******************************************************************************* 40 * Structures and Typedefs * 41 *******************************************************************************/ 42 /** 43 * Path rewrite. 44 */ 45 typedef struct __libc_PathRewrite 46 { 47 /** Flags. 48 * If __LIBC_PRWF_CASE_SENSITIVE is not set pszFrom *must* be in all 49 * lower case. */ 50 unsigned fFlags; 51 /** From path. Unix slashes! */ 52 const char *pszFrom; 53 /** Length of from path. */ 54 unsigned cchFrom; 55 /** To path. */ 56 const char *pszTo; 57 /** Length of to path. */ 58 unsigned cchTo; 59 /** Reserved 0 - intended for function pointer to special open. */ 60 unsigned uReserved0; 61 /** Reserved 1 - intended for function pointer to special parser. */ 62 unsigned uReserved1; 63 /** Reserved 2 - 8 byte alignment*/ 64 unsigned uReserved2; 65 } __LIBC_PATHREWRITE, *__LIBC_PPATHREWRITE; 66 67 68 /** @group __libc_PathReWrite_flags 69 * @{ */ 70 /** The rule rewrites a file. */ 71 #define __LIBC_PRWF_TYPE_FILE 0x00000001 72 /** The rule rewrites a directory. */ 73 #define __LIBC_PRWF_TYPE_DIR 0x00000002 74 75 /** From path is case sensitive. */ 76 #define __LIBC_PRWF_CASE_SENSITIVE 0x00000010 77 /** From path is case insensitive. */ 78 #define __LIBC_PRWF_CASE_INSENSITIVE 0x00000000 79 /** @} */ 80 81 __BEGIN_DECLS 82 83 /** 84 * Adds a set of new rules to the rewrite rule set. 85 * 86 * The rules will be validated before any of them are processed 87 * and added to the current rewrite rule set. Make sure the rules 88 * conform to the specifications. 89 * 90 * The rewrites are 1:1, no nested processing. 91 * 92 * @returns 0 on success. 93 * @returns -1 and errno set on failure. 94 * @param paRules Pointer to an array of rules to add. 95 * The rules will _not_ be duplicated but used until 96 * a remove call is issued. 97 * @param cRules Number of rules in the array. 98 */ 99 int __libc_PathRewriteAdd(const __LIBC_PPATHREWRITE paRules, unsigned cRules); 100 101 102 /** 103 * Removes a set of rules from the current rewrite rule set. 104 * 105 * The specified rule array must be the eact same as for the add call. 106 * 107 * @returns 0 on success. 108 * @returns -1 and errno set on failure. 109 * @param paRules Pointer to an array of rules to remove. 110 * @param cRules Number of rules in the array. 111 */ 112 int __libc_PathRewriteRemove(const __LIBC_PPATHREWRITE paRules, unsigned cRules); 113 114 115 /** 116 * Rewrites a path using a caller supplied buffer. 117 * 118 * @returns 0 if no rewrite was necessary. 119 * @returns length of the rewritten name including the terminating zero. 120 * @returns -1 on failure, errno not set. 121 * @param pszPath Path to rewrite. 122 * @param pszBuf Where to store the rewritten path. 123 * This can be NULL. 124 * @param cchBuf Size of the buffer. 125 */ 126 int __libc_PathRewrite(const char *pszPath, char *pszBuf, unsigned cchBuf); 127 128 129 __END_DECLS 130 131 /** @} */ 132 #endif 133 1 #include <klibc/pathrewrite.h> -
trunk/libc/include/InnoTekLIBC/tcpip.h
r2739 r2916 25 25 */ 26 26 27 #ifndef __ InnoTekLIBC_tcpip_h__28 #define __ InnoTekLIBC_tcpip_h__27 #ifndef __klibc_tcpip_h__ 28 #define __klibc_tcpip_h__ 29 29 30 30 #include <errno.h> 31 31 #include <sys/socket.h> 32 #include < emx/io.h>32 #include <klibc/io.h> 33 33 34 34 -
trunk/libc/include/klibc/backend.h
r2914 r2916 28 28 #define __klibc_backend_h__ 29 29 30 #ifndef __STDC_LIMIT_MACROS 31 # define __STDC_LIMIT_MACROS 32 #endif 33 #ifndef __STDC_CONSTANT_MACROS 34 # define __STDC_CONSTANT_MACROS 35 #endif 36 #include <stdint.h> 30 37 #include <stdarg.h> 31 38 #include <sys/cdefs.h> … … 140 147 * @returns -EINTR if the interrupted by signal. 141 148 142 * @param u llNanoReq Time to sleep, in nano seconds.143 * @param pu llNanoRem Where to store remaining time (also nano seconds).149 * @param u64NanoReq Time to sleep, in nano seconds. 150 * @param pu64NanoRem Where to store remaining time (also nano seconds). 144 151 145 152 * @remark For relativly small sleeps this api temporarily changes the thread … … 149 156 * It also means that if such code changes the priority it will be undone. 150 157 */ 151 int __libc_Back_threadSleep(u nsigned long long ullNanoReq, unsigned long long *pullNanoRem);158 int __libc_Back_threadSleep(uint64_t u64NanoReq, uint64_t *pu64NanoRem); 152 159 153 160 /** @} */ … … 571 578 * 572 579 * @param pFH Pointer to the handle structure to operate on. 573 * @param fh It's associated filehandle.574 580 * @param iRequest Which file file descriptior request to perform. 575 581 * @param iArg Argument which content is specific to each … … 578 584 * returned to the caller. 579 585 */ 580 int __libc_Back_ioFileControlStandard(__LIBC_PFH pFH, int fh, intiRequest, intptr_t iArg, int *prc);586 int __libc_Back_ioFileControlStandard(__LIBC_PFH pFH, int iRequest, intptr_t iArg, int *prc); 581 587 582 588 /** -
trunk/libc/include/klibc/os2/os2.h
r2915 r2916 31 31 #define INCL_BASE 32 32 #define INCL_DOSINFOSEG 33 #define INCL_DOSSIGNALS 33 34 #define INCL_DOSUNDOCUEMENTED 34 35 #define INCL_ERRORS … … 39 40 #include <os2emx.h> 40 41 #include <os2thunk.h> 42 #include <klibc/os2/os2error.h> 41 43 42 44 #ifndef HFILE_STDERR -
trunk/libc/include/klibc/pathrewrite.h
r2899 r2916 2 2 /** @file 3 3 * 4 * InnoTekLIBC - Path Rewrite.4 * kLIBC - Path Rewrite. 5 5 * 6 * Copyright (c) 2004-200 5knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * 9 * This file is part of InnoTekLIBC.9 * This file is part of kLIBC. 10 10 * 11 * InnoTekLIBC is free software; you can redistribute it and/or modify11 * kLIBC is free software; you can redistribute it and/or modify 12 12 * it under the terms of the GNU Lesser General Public License as published 13 13 * by the Free Software Foundation; either version 2 of the License, or 14 14 * (at your option) any later version. 15 15 * 16 * InnoTekLIBC is distributed in the hope that it will be useful,16 * kLIBC is distributed in the hope that it will be useful, 17 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 20 20 * 21 21 * You should have received a copy of the GNU Lesser General Public License 22 * along with InnoTekLIBC; if not, write to the Free Software22 * along with kLIBC; if not, write to the Free Software 23 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 24 * … … 26 26 27 27 28 #ifndef __libc_InnoTekLIBC_pathrewrite_h__ 29 #define __libc_InnoTekLIBC_pathrewrite_h__ 30 /** @group __libc_PathReWrite 31 * @{ */ 28 #ifndef __klibc_pathrewrite_h__ 29 #define __klibc_pathrewrite_h__ 30 31 /** @group __libc_PathReWrite Path Rewrite 32 * @{ 33 */ 34 32 35 33 36 /******************************************************************************* -
trunk/libc/include/libc-alias.h
r2446 r2916 35 35 #include "libc-std.h" 36 36 37 void __libc_Timebomb(void); 37 38 #ifdef TIMEBOMB 38 void __libc_Timebomb(void);39 39 asm(".stabs \"___libc_Timebomb\",1,0,0,0"); 40 40 #endif -
trunk/libc/src/kNIX/b_signalSendPid.c
r2905 r2916 32 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 33 33 #include <klibc/logstrict.h> 34 #ifdef __OS2__ /* later on NT. */35 # include "os2/b_signal.h"36 #endif37 34 38 35 -
trunk/libc/src/kNIX/kNIX.h
r2915 r2916 29 29 30 30 #define _GNU_SOURCE 31 #define INCL_TCPIP_ALLIOCTLS 32 #define _BSD_NAMESPACE_POLLUTION 31 33 32 34 #include "libc-alias.h" … … 52 54 #include <sys/fmutex.h> 53 55 #include <sys/fcntl.h> 56 #include <sys/filio.h> 54 57 #include <sys/mman.h> 55 58 #include <sys/mount.h> 59 #include <sys/queue.h> 56 60 #include <sys/resource.h> 57 61 #include <sys/smutex.h> … … 59 63 #include <sys/types.h> 60 64 #include <sys/syslimits.h> 65 #define _KERNEL 66 #include <sys/shm.h> 67 #include <sys/sem.h> 68 #undef _KERNEL 61 69 #include <klibc/io.h> 62 #include <klibc/umalloc.h> 70 #include <klibc/initterm.h> 71 #include <klibc/pathrewrite.h> 63 72 #include <klibc/thread.h> 64 73 #include <klibc/time.h> 74 #include <klibc/umalloc.h> 65 75 #include <klibc/backend.h> 66 76 -
trunk/libc/src/kNIX/os2/DosAllocMemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosAllocMemEx.5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>4 * kNIX - DosAllocMemEx. 5 * 6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * Copyright (c) 2004 nickk 8 8 * … … 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #define INCL_ERRORS 33 #define INCL_DOSMEMMGR 34 #define INCL_FSMACROS 35 #define INCL_EXAPIS 36 #include <os2emx.h> 37 #include <386/builtin.h> 38 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 39 #include <InnoTekLIBC/logstrict.h> 31 #include "kNIX.h" 40 32 #include "DosEx.h" 33 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 34 #include <klibc/logstrict.h> 41 35 42 36 -
trunk/libc/src/kNIX/os2/DosAllocSharedMemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosAllocSharedMemEx.4 * kNIX - DosAllocSharedMemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSMEMMGR 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosCloseEventSemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosCloseEventSemEx.4 * kNIX - DosCloseEventSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSSEMAPHORES 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosCloseMutexSemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosCloseMutexSemEx.4 * kNIX - DosCloseMutexSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSSEMAPHORES 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosCreateEventSemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosCreateEventSemEx.4 * kNIX - DosCreateEventSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSSEMAPHORES 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosCreateMutexSemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosCreateMutexSemEx.4 * kNIX - DosCreateMutexSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSSEMAPHORES 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosEx.c
r2914 r2916 2 2 /** @file 3 3 * 4 * Dos API Extension Fundament.5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>4 * kNIX - Dos API Extension Fundament. 5 * 6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 35 35 * Header Files * 36 36 *******************************************************************************/ 37 #include "libc-alias.h" 38 #define INCL_ERRORS 39 #define INCL_DOS 40 #define INCL_FSMACROS 41 #define INCL_EXAPIS 42 #include <os2emx.h> 43 #include <errno.h> 44 #include <stdlib.h> 45 #include <string.h> 46 #include <emx/startup.h> 47 #include <386/builtin.h> 48 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_HEAP /* fixme */ 49 #include <InnoTekLIBC/logstrict.h> 50 #include <InnotekLIBC/fork.h> 37 #include "kNIX.h" 51 38 #include "DosEx.h" 52 #include "syscalls.h" 39 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 40 #include <klibc/logstrict.h> 53 41 54 42 -
trunk/libc/src/kNIX/os2/DosFreeMemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosFreeMemEx.4 * kNIX - DosFreeMemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSMEMMGR 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosFreeModuleEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosFreeModuleEx.4 * kNIX - DosFreeModuleEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSMODULEMGR 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosGetNamedSharedMemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosGetNamedSharedMemEx.4 * kNIX - DosGetNamedSharedMemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSMEMMGR 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosGetSharedMemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosGetSharedMemEx.4 * kNIX - DosGetSharedMemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSMEMMGR 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosLoadModuleEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosCreateEventSemEx.4 * kNIX - DosCreateEventSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSMODULEMGR 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 39 31 40 32 -
trunk/libc/src/kNIX/os2/DosOpenEventSemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosOpenEventSemEx.4 * kNIX - DosOpenEventSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSSEMAPHORES 33 #define INCL_FSMACROS 34 #define INCL_EXAPIS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 27 #include "kNIX.h" 38 28 #include "DosEx.h" 39 29 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 30 #include <klibc/logstrict.h> 40 31 41 32 /** -
trunk/libc/src/kNIX/os2/DosOpenMutexSemEx.c
r2913 r2916 2 2 /** @file 3 3 * 4 * DosOpenMutexSemEx.4 * kNIX - DosOpenMutexSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_ERRORS 32 #define INCL_DOSSEMAPHORES 33 #define INCL_EXAPIS 34 #define INCL_FSMACROS 35 #include <os2emx.h> 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 37 #include <InnoTekLIBC/logstrict.h> 30 #include "kNIX.h" 38 31 #include "DosEx.h" 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_DOSEX 33 #include <klibc/logstrict.h> 39 34 40 35 -
trunk/libc/src/kNIX/os2/FastInfoBlocks.c
r2913 r2916 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #define INCL_DOSINFOSEG 33 #define INCL_DOSPROCESS 34 #define INCL_FSMACROS 35 #include <os2emx.h> 36 #include <klibc/fib.h> 31 #include "kNIX.h" 37 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_MISC 38 #include < InnoTekLIBC/logstrict.h>33 #include <klibc/logstrict.h> 39 34 40 35 -
trunk/libc/src/kNIX/os2/__select.c
r2914 r2916 25 25 */ 26 26 27 #include "libc-alias.h" 28 #define INCL_FSMACROS 29 #define INCL_DOSSEMAPHORES 30 #define INCL_ERRORS 31 #include <os2emx.h> 32 #include <stdlib.h> 33 #include <string.h> 34 #include <errno.h> 35 #include <sys/time.h> 27 #include "kNIX.h" 36 28 #include <sys/select.h> 37 #include <emx/io.h>38 29 #include <emx/syscalls.h> 39 #include "syscalls.h"40 #include "backend.h"41 30 42 31 … … 96 85 || (exceptfds && FD_ISSET(i, exceptfds))) 97 86 { 98 PLIBCFH pFH = __libc_FH(i); 99 if (!pFH) 87 __LIBC_PFH pFH; 88 int rc = __libc_FHGet(i, &pFH); 89 if (rc) 100 90 { 101 errno = EBADF;91 errno = -rc; 102 92 return -1; 103 93 } … … 109 99 || (pfnSelect && pFH->pOps->pfnSelect != pfnSelect)) 110 100 { 101 102 __libc_FHPut(pFH); 111 103 errno = EINVAL; 112 104 return -1; … … 127 119 if (!pLookAhead) 128 120 { 121 __libc_FHPut(pFH); 129 122 errno = ENOMEM; 130 123 return -1; … … 135 128 cLookAhead++; 136 129 } 130 __libc_FHPut(pFH); 137 131 } 138 132 } … … 188 182 { 189 183 if (rc > 0) 190 _sys_set_errno(rc);184 errno = __libc_back_native2errno(rc); 191 185 else 192 186 errno = -rc; -
trunk/libc/src/kNIX/os2/b_ioFileControl.c
r2915 r2916 4 4 * kNIX - File Control. 5 5 * 6 * Copyright (c) 2003-200 5knut st. osmundsen <bird-src-spam@innotek.de>6 * Copyright (c) 2003-2006 knut st. osmundsen <bird-src-spam@innotek.de> 7 7 * 8 8 * … … 72 72 * Standard OS/2 handle. 73 73 */ 74 rc = __libc_Back_ioFileControlStandard(pFH, fh,iRequest, iArg, prc);74 rc = __libc_Back_ioFileControlStandard(pFH, iRequest, iArg, prc); 75 75 } 76 76 else … … 101 101 * 102 102 * @param pFH Pointer to the handle structure to operate on. 103 * @param fh It's associated filehandle.104 103 * @param iRequest Which file file descriptior request to perform. 105 104 * @param iArg Argument which content is specific to each … … 108 107 * returned to the caller. 109 108 */ 110 int __libc_Back_ioFileControlStandard(__LIBC_PFH pFH, int fh, intiRequest, intptr_t iArg, int *prc)111 { 112 LIBCLOG_ENTER("pFH=%p fh=%d iRequest=%#x iArg=%#x prc=%p\n", (void *)pFH, fh, iRequest, iArg, (void *)prc);109 int __libc_Back_ioFileControlStandard(__LIBC_PFH pFH, int iRequest, intptr_t iArg, int *prc) 110 { 111 LIBCLOG_ENTER("pFH=%p iRequest=%#x iArg=%#x prc=%p\n", (void *)pFH, iRequest, iArg, (void *)prc); 113 112 114 113 switch (iRequest) … … 141 140 case F_GETFD: 142 141 { 143 int rc = __fcntl_getfd(pFH, fh, prc);142 int rc = __fcntl_getfd(pFH, pFH->fh, prc); 144 143 LIBCLOG_MIX0_RETURN_INT(rc); 145 144 } … … 151 150 { 152 151 *prc = 0; 153 int rc = __fcntl_setfd(pFH, fh, (int)iArg);152 int rc = __fcntl_setfd(pFH, pFH->fh, (int)iArg); 154 153 LIBCLOG_MIX0_RETURN_INT(rc); 155 154 } … … 163 162 { 164 163 *prc = 0; 165 int rc = __fcntl_locking( fh, iRequest, (struct flock*)iArg);164 int rc = __fcntl_locking(pFH->fh, iRequest, (struct flock*)iArg); 166 165 LIBCLOG_MIX0_RETURN_INT(rc); 167 166 } -
trunk/libc/src/kNIX/os2/b_panic.c
r2914 r2916 33 33 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_NOGROUP 34 34 #include <klibc/logstrict.h> 35 36 37 /*******************************************************************************38 * Defined Constants And Macros *39 *******************************************************************************/40 /** OS/2 default standard error handle. */41 #define HFILE_STDERR ((HFILE)2)42 35 43 36 -
trunk/libc/src/kNIX/os2/b_signalTimer.c
r2914 r2916 4 4 * kNIX - setitimer() & getitimer(). 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #define INCL_BASE 33 #define INCL_FSMACROS 34 #define INCL_DOSINFOSEG 35 #define INCL_ERRORS 36 #include <os2emx.h> 37 #include <signal.h> 38 #include <errno.h> 39 #include <386/builtin.h> 40 #include <InnoTekLIBC/backend.h> 41 #include <InnoTekLIBC/thread.h> 31 #include "kNIX.h" 42 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 43 #include <InnoTekLIBC/logstrict.h> 44 #include "b_signal.h" 45 #include "backend.h" 33 #include <klibc/logstrict.h> 46 34 47 35 -
trunk/libc/src/kNIX/os2/b_signalWait.c
r2913 r2916 4 4 * kNIX - signal wait. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 30 30 * Header Files * 31 31 *******************************************************************************/ 32 #define INCL_BASE 33 #define INCL_FSMACROS 34 #include <os2emx.h> 35 36 #include <signal.h> 37 #include <errno.h> 38 #include <386/builtin.h> 39 #include "b_signal.h" 40 #include <InnoTekLIBC/thread.h> 41 #include <InnoTekLIBC/backend.h> 32 #include "kNIX.h" 42 33 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_SIGNAL 43 #include < InnoTekLIBC/logstrict.h>34 #include <klibc/logstrict.h> 44 35 45 36 -
trunk/libc/src/kNIX/os2/b_threadCleanup.c
r2913 r2916 4 4 * kNIX - Thread structure cleanup. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_DOS 32 #define INCL_FSMACROS 33 #include <os2emx.h> 34 #include "syscalls.h" 35 #include <InnoTekLIBC/thread.h> 36 #include <InnoTekLIBC/backend.h> 27 #include "kNIX.h" 37 28 38 29 void __libc_Back_threadCleanup(__LIBC_PTHREAD pThrd) … … 50 41 } 51 42 } 43 -
trunk/libc/src/kNIX/os2/b_threadEnd.c
r2913 r2916 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #include <errno.h> 33 #define INCL_DOS 34 #define INCL_FSMACROS 35 #include <os2emx.h> 36 #include <InnoTekLIBC/backend.h> 27 #include "kNIX.h" 37 28 38 29 void __libc_Back_threadEnd(void *pExpRegRec) … … 43 34 FS_RESTORE(); 44 35 } 36 -
trunk/libc/src/kNIX/os2/b_threadInit.c
r2913 r2916 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_DOSEXCEPTIONS 32 #define INCL_FSMACROS 33 #include <os2emx.h> 34 #include <sys/signal.h> 35 #include <emx/syscalls.h> 36 #include "syscalls.h" 37 #include "b_signal.h" 38 #include <InnoTekLIBC/thread.h> 39 #include <InnoTekLIBC/backend.h> 40 27 #include "kNIX.h" 41 28 42 29 void __libc_Back_threadInit(__LIBC_PTHREAD pThrd, const __LIBC_PTHREAD pParentThrd) -
trunk/libc/src/kNIX/os2/b_threadSleep.c
r2913 r2916 4 4 * kNIX - nanosleep(). 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 * … … 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #define INCL_BASE 33 #define INCL_FSMACROS 34 #include <os2emx.h> 35 36 #include <unistd.h> 37 #include <errno.h> 38 #include <InnoTekLIBC/thread.h> 39 #include <InnoTekLIBC/backend.h> 27 #include "kNIX.h" 40 28 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_THREAD 41 #include <InnoTekLIBC/logstrict.h> 42 #include <klibc/fib.h> 43 #include "b_signal.h" 44 29 #include <klibc/logstrict.h> 45 30 46 31 /** … … 52 37 * @returns -EINTR if the interrupted by signal. 53 38 54 * @param u llNanoReq Time to sleep, in nano seconds.55 * @param pu llNanoRem Where to store remaining time (also nano seconds).39 * @param u64NanoReq Time to sleep, in nano seconds. 40 * @param pu64NanoRem Where to store remaining time (also nano seconds). 56 41 57 42 * @remark For relativly small sleeps this api temporarily changes the thread … … 61 46 * It also means that if such code changes the priority it will be undone. 62 47 */ 63 int __libc_Back_threadSleep(u nsigned long long ullNanoReq, unsigned long long *pullNanoRem)48 int __libc_Back_threadSleep(uint64_t u64NanoReq, uint64_t *pu64NanoRem) 64 49 { 65 LIBCLOG_ENTER("u llNanoReq=%lld pullNanoRem=%p", ullNanoReq, (void *)pullNanoRem);50 LIBCLOG_ENTER("u64NanoReq=%lld pu64NanoRem=%p", (long long)u64NanoReq, (void *)pu64NanoRem); 66 51 ULONG msTSStart = fibGetMsCount(); 67 52 ULONG msSleep; … … 73 58 * If zero, yield. 74 59 */ 75 if (u llNanoReq == 0)60 if (u64NanoReq == 0) 76 61 { 77 62 LIBCLOG_MSG("DosSleep(0)\n"); … … 83 68 * Infinite wait 84 69 */ 85 else if (u llNanoReq == ~0ULL)70 else if (u64NanoReq == ~0ULL) 86 71 { 87 72 LIBCLOG_MSG("DosSleep(~0)\n"); … … 93 78 * Less than 49 days wait but not infinite.. 94 79 */ 95 else if (u llNanoReq < 0xfffffff0ULL * 1000000ULL)80 else if (u64NanoReq < 0xfffffff0ULL * 1000000ULL) 96 81 { 97 82 /* 98 83 * Calc millisecond wait. 99 84 */ 100 msSleep = (ULONG)( (u llNanoReq + 999999) / 1000000 );85 msSleep = (ULONG)( (u64NanoReq + 999999) / 1000000 ); 101 86 102 87 /* … … 166 151 */ 167 152 /** @todo the interrupt case is wrong if we're interrupted after more than 49 days... */ 168 unsigned long long ullMilliesSleep = (u llNanoReq + 999999) / 1000000;153 unsigned long long ullMilliesSleep = (u64NanoReq + 999999) / 1000000; 169 154 do 170 155 { … … 186 171 */ 187 172 if ( fInterrupted 188 && pu llNanoRem)173 && pu64NanoRem) 189 174 { 190 175 ULONG msSlept = fibGetMsCount() - msTSStart; 191 176 if (msSleep <= msSlept) 192 *pu llNanoRem = 0;177 *pu64NanoRem = 0; 193 178 else 194 179 { 195 180 unsigned long long ullNanoRem = (msSleep - msSlept) * 10000000ULL; 196 *pu llNanoRem = ullNanoRem >= ullNanoReq ? ullNanoReq - 1 : ullNanoRem;181 *pu64NanoRem = ullNanoRem >= u64NanoReq ? u64NanoReq - 1 : ullNanoRem; 197 182 } 198 183 } -
trunk/libc/src/kNIX/os2/b_threadStartup.c
r2913 r2916 25 25 */ 26 26 27 28 /******************************************************************************* 29 * Header Files * 30 *******************************************************************************/ 31 #include "libc-alias.h" 32 #define INCL_DOS 33 #define INCL_FSMACROS 34 #include <os2emx.h> 35 #include <InnoTekLIBC/backend.h> 36 27 #include "kNIX.h" 37 28 38 29 void __libc_Back_threadStartup(void *pExpRegRec) -
trunk/libc/src/kNIX/os2/exceptions.c
r2913 r2916 30 30 * Header Files * 31 31 *******************************************************************************/ 32 #define INCL_BASE 33 #define INCL_FSMACROS 34 #include <os2emx.h> 35 36 #include <signal.h> 37 #include <errno.h> 38 #include <386/builtin.h> 39 #include <InnoTekLIBC/thread.h> 40 #include <InnoTekLIBC/backend.h> 32 #include "kNIX.h" 41 33 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_SIGNAL 42 #include <InnoTekLIBC/logstrict.h> 43 #include "b_signal.h" 34 #include <klibc/logstrict.h> 44 35 45 36 -
trunk/libc/src/kNIX/os2/filefind.c
r2732 r2916 6 6 * Header Files * 7 7 *******************************************************************************/ 8 #include "libc-alias.h" 9 #define INCL_BASE 10 #define INCL_FSMACROS 11 #include <os2emx.h> 12 #include "b_fs.h" 13 #include <stdlib.h> 14 #include <string.h> 15 #include <errno.h> 16 #include <limits.h> 8 #include "kNIX.h" 17 9 #include <emx/syscalls.h> 18 #include "syscalls.h"19 #include <InnoTekLIBC/thread.h>20 #include <InnoTekLIBC/pathrewrite.h>21 10 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_IO 22 #include <InnoTekLIBC/logstrict.h> 11 #include <klibc/logstrict.h> 12 13 14 /******************************************************************************* 15 * Defined Constants And Macros * 16 *******************************************************************************/ 17 /** This macro is used for accessing FDATE or FTIME values as USHORT. */ 18 #define XUSHORT(x) (*(USHORT *)&(x)) 19 23 20 24 21 /** … … 184 181 pFD->cFiles = 0; 185 182 pFD->pchNext = NULL; 186 _sys_set_errno(rc);183 errno = __libc_back_native2errno(rc); 187 184 LIBCLOG_ERROR_RETURN_INT(-1); 188 185 } … … 234 231 { 235 232 find_close(pFD); 236 _sys_set_errno(rc);233 errno = __libc_back_native2errno(rc); 237 234 return -1; 238 235 } -
trunk/libc/src/kNIX/os2/fs-os2.c
r2903 r2916 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #include "kNIX.h" 31 32 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_FS 32 #define _GNU_SOURCE33 #include "kNIX.h"34 #include <InnoTekLIBC/sharedpm.h>35 #include <InnoTekLIBC/pathrewrite.h>36 #include <klibc/backend.h>37 33 #include <klibc/logstrict.h> 38 34 -
trunk/libc/src/kNIX/os2/heaphigh.c
r2739 r2916 23 23 * 24 24 */ 25 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 30 #include "kNIX.h" 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_HEAP 32 #include <klibc/logstrict.h> 25 33 26 34 … … 39 47 /** Round chunk size. */ 40 48 #define HIMEM_ROUND_SIZE(cb, align) ( ((cb) + (align) - 1) & ~((align) - 1) ) 41 42 43 44 /*******************************************************************************45 * Header Files *46 *******************************************************************************/47 #include "libc-alias.h"48 #define INCL_DOSMEMMGR49 #define INCL_EXAPIS50 #define INCL_ERRORS51 #include <os2emx.h>52 #include <string.h>53 #include <emx/umalloc.h>54 #include "syscalls.h"55 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_HEAP56 #include <InnoTekLIBC/logstrict.h>57 49 58 50 … … 542 534 int __libc_HasHighMem(void) 543 535 { 544 return _ sys_gcbVirtualAddressLimit > 512*1024*1024;545 } 546 536 return __libc_back_gcbVirtualAddressLimit > 512*1024*1024; 537 } 538 -
trunk/libc/src/kNIX/os2/hooks.c
r2913 r2916 59 59 */ 60 60 61 62 /******************************************************************************* 63 * Header Files * 64 *******************************************************************************/ 65 #define _GNU_SOURCE 66 #include "libc-alias.h" 67 #define INCL_BASE 68 #define INCL_EXAPIS 69 #include <os2emx.h> 70 #include "backend.h" 71 #include <stddef.h> 72 #include <string.h> 73 #include <errno.h> 74 #include "syscalls.h" 75 #include <InnoTekLIBC/backend.h> 76 #include <InnoTekLIBC/pathrewrite.h> 61 #include "kNIX.h" 77 62 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_INITTERM 78 #include <InnoTekLIBC/logstrict.h> 79 80 63 #include <klibc/logstrict.h> 81 64 82 65 /** … … 84 67 * specification string. 85 68 */ 86 void __libc_back_hooksInit (const char *pszSpec, unsigned longhmod)69 void __libc_back_hooksInit (const char *pszSpec, uintptr_t hmod) 87 70 { 88 71 LIBCLOG_ENTER("pszSpec=%s\n", pszSpec); -
trunk/libc/src/kNIX/os2/kNIX-os2.h
r2915 r2916 283 283 /** @} */ 284 284 285 286 /** Virtual address limit and high memory indicator. 287 * 288 * Zero means limit is 512MB. 289 * Non zero means more that 512MB. The value is then the size of then the user 290 * address space size in bytes. 291 * 292 * Initiated by __init_dll(). 293 */ 294 extern size_t __libc_back_gcbVirtualAddressLimit; 295 285 296 __END_DECLS 286 297 -
trunk/libc/src/kNIX/os2/libcfork.c
r2915 r2916 2 2 /** @file 3 3 * 4 * kNIX fork().5 * 6 * Copyright (c) 2004-200 5knut st. osmundsen <bird-srcspam@anduin.net>4 * kNIX - fork(), OS/2. 5 * 6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * -
trunk/libc/src/kNIX/os2/os2error.c
r2913 r2916 4 4 * kNIX - DosError() Wrapping. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #define INCL_BASE 32 #define INCL_FSMACROS 33 #include <os2emx.h> 34 #include <InnoTekLIBC/os2error.h> 35 30 #include "kNIX.h" 36 31 37 32 -
trunk/libc/src/kNIX/os2/pathrewrite.c
r2913 r2916 45 45 * Header Files * 46 46 *******************************************************************************/ 47 #include <InnoTekLIBC/pathrewrite.h> 48 #include <InnoTekLIBC/libc.h> 47 #include "kNIX.h" 49 48 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_IO 50 #include <InnoTekLIBC/logstrict.h> 51 52 #include <string.h> 53 #include <errno.h> 54 #include <stdlib.h> 55 #include <emx/startup.h> 56 #include <emx/umalloc.h> 57 58 #define INCL_BASE 59 #include <os2.h> 49 #include <klibc/logstrict.h> 60 50 61 51 … … 763 753 LIBCLOG_RETURN_INT(0); 764 754 } 755 -
trunk/libc/src/kNIX/os2/signals.c
r2914 r2916 4 4 * kNIX - Signals. 5 5 * 6 * Copyright (c) 2004-200 5knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 66 66 * Header Files * 67 67 *******************************************************************************/ 68 #include "libc-alias.h" 69 #define INCL_BASE 70 #define INCL_DOSSIGNALS 71 #define INCL_FSMACROS 72 #define INCL_EXAPIS 73 #include <os2emx.h> 74 75 #include <signal.h> 76 #include <errno.h> 77 #include <string.h> 78 #include <malloc.h> 79 #include <386/builtin.h> 80 #include <emx/umalloc.h> 81 #include <InnoTekLIBC/thread.h> 82 #include <InnoTekLIBC/fork.h> 83 #include <InnoTekLIBC/backend.h> 84 #include <klibc/fib.h> 68 #include "kNIX.h" 85 69 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_SIGNAL 86 #include <InnoTekLIBC/logstrict.h> 87 #include "syscalls.h" 88 #include "backend.h" 89 #include "b_signal.h" 90 #include "b_process.h" 70 #include <klibc/logstrict.h> 91 71 92 72 … … 94 74 * Defined Constants And Macros * 95 75 *******************************************************************************/ 96 /** OS/2 default standard error handle. */97 #define HFILE_STDERR ((HFILE)2)98 99 76 /** @defgroup libc_back_signals_properties Signal Properties 100 77 * The return actions are ordered by precendece. … … 917 894 SigInfo.si_flags |= __LIBC_SI_QUEUED; 918 895 if (!SigInfo.si_pid) 919 SigInfo.si_pid = _sys_pid;896 SigInfo.si_pid = fibGetPid(); 920 897 if (!SigInfo.si_tid && pThrd) 921 898 SigInfo.si_tid = pThrd->tid; … … 1024 1001 SigInfo.si_flags |= __LIBC_SI_QUEUED; 1025 1002 if (!SigInfo.si_pid) 1026 SigInfo.si_pid = _sys_pid;1003 SigInfo.si_pid = fibGetPid(); 1027 1004 if (!SigInfo.si_tid) 1028 1005 SigInfo.si_tid = pThrd->tid; … … 1355 1332 /* Shit! We failed to queue it on a thread. Try put it back in the 1st level queue. */ 1356 1333 LIBCLOG_MSG("failed to schedule signal %d for any thread!\n", iSignalNo); 1357 __libc_spmSigQueue(SigInfo.si_signo, &SigInfo, _sys_pid, !!(SigInfo.si_flags & __LIBC_SI_QUEUED));1334 __libc_spmSigQueue(SigInfo.si_signo, &SigInfo, fibGetPid(), !!(SigInfo.si_flags & __LIBC_SI_QUEUED)); 1358 1335 break; 1359 1336 } … … 2046 2023 siginfo_t SigInfo = {0}; 2047 2024 SigInfo.si_signo = SIGCHLD; 2048 SigInfo.si_pid = _sys_pid;2025 SigInfo.si_pid = fibGetPid(); 2049 2026 SigInfo.si_code = CLD_STOPPED; 2050 2027 SigInfo.si_status = iSignalNo; 2051 2028 SigInfo.si_flags = __LIBC_SI_INTERNAL; 2052 __libc_back_signalSendPidOther( _sys_ppid, SIGCHLD, &SigInfo);2029 __libc_back_signalSendPidOther(fibGetPPid(), SIGCHLD, &SigInfo); 2053 2030 2054 2031 /* … … 2075 2052 siginfo_t SigInfo = {0}; 2076 2053 SigInfo.si_signo = SIGCHLD; 2077 SigInfo.si_pid = _sys_pid;2054 SigInfo.si_pid = fibGetPid(); 2078 2055 SigInfo.si_code = CLD_CONTINUED; 2079 2056 SigInfo.si_status = SIGCONT; 2080 2057 SigInfo.si_flags = __LIBC_SI_INTERNAL; 2081 __libc_back_signalSendPidOther( _sys_ppid, SIGCHLD, &SigInfo);2058 __libc_back_signalSendPidOther(fibGetPPid(), SIGCHLD, &SigInfo); 2082 2059 return 0; 2083 2060 } … … 2114 2091 SigInfo.si_code = SI_USER; 2115 2092 if (SigInfo.si_pid) 2116 SigInfo.si_pid = _sys_pid;2093 SigInfo.si_pid = fibGetPid(); 2117 2094 __LIBC_PTHREAD pThrd = __libc_threadCurrentNoAuto(); 2118 2095 if (pThrd) … … 2294 2271 SigInfo.si_code = SI_USER; 2295 2272 if (SigInfo.si_pid) 2296 SigInfo.si_pid = _sys_pid;2273 SigInfo.si_pid = fibGetPid(); 2297 2274 __LIBC_PTHREAD pThrd = __libc_threadCurrent(); 2298 2275 if (pThrd) -
trunk/libc/src/kNIX/os2/syscalls.h
r2914 r2916 31 31 #endif 32 32 33 /* This macro is used for accessing FDATE or FTIME values as34 USHORT. */35 36 #define XUSHORT(x) (*(USHORT *)&(x))37 38 33 EXTERN unsigned _sys_uflags INIT (0); 39 34 EXTERN unsigned long _sys_clock0_ms INIT (0); … … 42 37 EXTERN int _sys_ppid;*/ 43 38 44 /** Virtual address limit and high memory indicator. 45 * 46 * Zero means limit is 512MB. 47 * Non zero means more that 512MB. The value is then the size of then the user 48 * address space size in bytes. 49 * 50 * Initiated by __init_dll(). 51 */ 52 EXTERN unsigned long _sys_gcbVirtualAddressLimit; 39 /*EXTERN unsigned long _sys_gcbVirtualAddressLimit;*/ 53 40 54 41 -
trunk/libc/src/kNIX/os2/sysv_sem.c
r2914 r2916 7 7 */ 8 8 9 #include "libc-alias.h" 10 #include <sys/cdefs.h> 9 //#include <sys/cdefs.h> 11 10 //__FBSDID("$FreeBSD: src/sys/kern/sysv_sem.c,v 1.70.2.3 2005/03/22 17:20:07 sam Exp $"); 12 11 13 #include <sys/types.h> 14 #define _KERNEL 15 #include <sys/sem.h> 16 #undef _KERNEL 17 #define INCL_DOSSEMAPHORES 18 #define INCL_DOSEXCEPTIONS 19 #define INCL_DOSERRORS 20 #define INCL_FSMACROS 21 #define INCL_EXAPIS 22 #include <os2emx.h> 23 #include "syscalls.h" 24 #include <string.h> 25 #include <errno.h> 26 #include <emx/umalloc.h> 27 #include <sys/param.h> 28 #include <sys/queue.h> 29 #include <386/builtin.h> 30 #include <InnoTekLIBC/sharedpm.h> 31 #include <InnoTekLIBC/thread.h> 32 #include <klibc/fib.h> 33 #include <InnoTekLIBC/libc.h> 34 #include <InnoTekLIBC/backend.h> 12 #include "kNIX.h" 35 13 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_IPC 36 #include < InnoTekLIBC/logstrict.h>14 #include <klibc/logstrict.h> 37 15 38 16 /* debug printf */ -
trunk/libc/src/kNIX/os2/sysv_shm.c
r2914 r2916 30 30 */ 31 31 32 #define _BSD_NAMESPACE_POLLUTION 33 #include "libc-alias.h" 34 #include <sys/cdefs.h> 32 //#include <sys/cdefs.h> 35 33 //__FBSDID("$FreeBSD: src/sys/kern/sysv_shm.c,v 1.96.2.3 2005/02/19 19:54:31 csjp Exp $"); 36 34 37 #include <sys/types.h> 38 #define _KERNEL 39 #include <sys/shm.h> 40 #undef _KERNEL 41 #include <sys/mman.h> 42 #include <sys/stat.h> 43 #define INCL_DOSSEMAPHORES 44 #define INCL_DOSEXCEPTIONS 45 #define INCL_DOSMEMMGR 46 #define INCL_DOSERRORS 47 #define INCL_FSMACROS 48 #define INCL_EXAPIS 49 #include <os2emx.h> 50 #include "syscalls.h" 51 #include <string.h> 52 #include <errno.h> 53 #include <emx/umalloc.h> 35 #include "kNIX.h" 54 36 #include <sys/param.h> 55 #include <sys/queue.h> 56 #include <386/builtin.h> 57 #include <InnoTekLIBC/sharedpm.h> 58 #include <InnoTekLIBC/thread.h> 59 #include <klibc/fib.h> 60 #include <InnoTekLIBC/libc.h> 61 #include <InnoTekLIBC/fork.h> 62 #include <InnoTekLIBC/backend.h> 63 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_FS 64 #include <InnoTekLIBC/logstrict.h> 37 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_FS 38 #include <klibc/logstrict.h> 65 39 66 40 /* debug printf */ -
trunk/libc/src/kNIX/os2/tcpip.c
r2914 r2916 37 37 * Header Files * 38 38 *******************************************************************************/ 39 #define INCL_DOSMODULEMGR 40 #include <os2emx.h> 41 42 43 #include <InnoTekLIBC/sharedpm.h> 39 #include "kNIX.h" 44 40 #include <InnoTekLIBC/tcpip.h> 45 #include <InnoTekLIBC/errno.h>46 41 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_SOCKET 47 #include < InnoTekLIBC/logstrict.h>42 #include <klibc/logstrict.h> 48 43 49 44 -
trunk/libc/src/kNIX/os2/tcpipver.c
r2913 r2916 2 2 /** @file 3 3 * 4 * kNIX - TCP/IP Version Specific Code .4 * kNIX - TCP/IP Version Specific Code, OS/2. 5 5 * 6 6 * This file is included from tcpipver43.c with TCPV40HDRS defined, … … 8 8 * 9 9 * 10 * Copyright (c) 2004-200 5knut st. osmundsen <bird-srcspam@anduin.net>10 * Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net> 11 11 * 12 12 * … … 33 33 * Header Files * 34 34 *******************************************************************************/ 35 # define INCL_TCPIP_ALLIOCTLS36 # include "libc-alias.h"37 #include < errno.h>38 #include <string.h> 35 #include "kNIX.h" 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_SOCKET 37 #include <klibc/logstrict.h> 38 39 39 #include <sys/socket.h> 40 40 #include <sys/sockio.h> … … 53 53 #include <net/route.h> 54 54 55 #include <sys/fcntl.h>56 #include <sys/filio.h>57 #include <sys/time.h>58 #include <386/builtin.h>59 #include <sys/smutex.h>60 #include <emx/io.h>61 #include <emx/startup.h>62 #define INCL_BASE63 #define INCL_FSMACROS64 #include <os2emx.h>65 #include <InnoTekLIBC/sharedpm.h>66 55 #include <InnoTekLIBC/tcpip.h> 67 #include <InnoTekLIBC/fork.h> 68 #include <InnoTekLIBC/thread.h> 69 #include <InnoTekLIBC/backend.h> 70 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_SOCKET 71 #include <InnoTekLIBC/logstrict.h> 72 73 #include "b_fs.h" 56 74 57 75 58 /******************************************************************************* … … 146 129 * Internal Functions * 147 130 *******************************************************************************/ 148 static int TCPNAME(ops_Close)( PLIBCFH pFH, int fh);149 static int TCPNAME(ops_Read)( PLIBCFH pFH, int fh, void *pvBuf, size_t cbRead, size_t *pcbRead);150 static int TCPNAME(ops_Write)( PLIBCFH pFH, int fh, const void *pvBuf, size_t cbWrite, size_t *pcbWritten);151 static int TCPNAME(ops_Duplicate)( PLIBCFH pFH, int fh, int *pfhNew);152 static int TCPNAME(ops_FileControl)( PLIBCFH pFH, int fh, int iIOControl, int iArg, int *prc);153 static int TCPNAME(ops_IOControl)( PLIBCFH pFH, int fh, int iIOControl, int iArg, int *prc);131 static int TCPNAME(ops_Close)(__LIBC_PFH pFH); 132 static int TCPNAME(ops_Read)(__LIBC_PFH pFH, void *pvBuf, size_t cbRead, size_t *pcbRead); 133 static int TCPNAME(ops_Write)(__LIBC_PFH pFH, const void *pvBuf, size_t cbWrite, size_t *pcbWritten); 134 static int TCPNAME(ops_Duplicate)(__LIBC_PFH pFH, int *pfhNew); 135 static int TCPNAME(ops_FileControl)(__LIBC_PFH pFH, int iIOControl, int iArg, int *prc); 136 static int TCPNAME(ops_IOControl)(__LIBC_PFH pFH, int iIOControl, int iArg, int *prc); 154 137 static int TCPNAME(ops_Select)(int cFHs, struct fd_set *pRead, struct fd_set *pWrite, struct fd_set *pExcept, struct timeval *tv, int *prc); 155 static int TCPNAME(ops_ForkChild)(struct __libc_FileHandle *pFH, int fh,__LIBC_PFORKHANDLE pForkHandle, __LIBC_FORKOP enmOperation);138 static int TCPNAME(ops_ForkChild)(struct __libc_FileHandle *pFH, __LIBC_PFORKHANDLE pForkHandle, __LIBC_FORKOP enmOperation); 156 139 157 140 static int TCPNAME(imp_soclose)(int s); … … 193 176 TCPNAME(ops_Read), 194 177 TCPNAME(ops_Write), 178 NULL /* fixme! */, 179 NULL /* fixme! */, 195 180 TCPNAME(ops_Duplicate), 196 181 TCPNAME(ops_FileControl), … … 198 183 TCPNAME(ops_Select), 199 184 NULL /* fork parent */, 200 TCPNAME(ops_ForkChild) 185 TCPNAME(ops_ForkChild), 186 42 201 187 }; 202 188 … … 208 194 * @param fh It's associated filehandle. 209 195 */ 210 static int TCPNAME(ops_Close)( PLIBCFH pFH, int fh)211 { 212 LIBCLOG_ENTER("pFH=%p:{ iSocket=%d} fh=%d\n", (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket,fh);196 static int TCPNAME(ops_Close)(__LIBC_PFH pFH) 197 { 198 LIBCLOG_ENTER("pFH=%p:{.iSocket=%d, .fh} fh=%d\n", (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, pFH->fh); 213 199 PLIBCSOCKETFH pSocketFH = (PLIBCSOCKETFH)pFH; 214 200 int rc; … … 287 273 * @param pcbRead Where to store the count of bytes actually read. 288 274 */ 289 static int TCPNAME(ops_Read)( PLIBCFH pFH, int fh, void *pvBuf, size_t cbRead, size_t *pcbRead)290 { 291 LIBCLOG_ENTER("pFH=%p:{ iSocket=%d} fh=%dpvBuf=%p cbRead=%d pcbRead=%p\n",292 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, fh, pvBuf, cbRead, (void *)pcbRead);275 static int TCPNAME(ops_Read)(__LIBC_PFH pFH, void *pvBuf, size_t cbRead, size_t *pcbRead) 276 { 277 LIBCLOG_ENTER("pFH=%p:{.iSocket=%d .fh=%d} pvBuf=%p cbRead=%d pcbRead=%p\n", 278 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, pFH->fh, pvBuf, cbRead, (void *)pcbRead); 293 279 PLIBCSOCKETFH pSocketFH = (PLIBCSOCKETFH)pFH; 294 280 int rc; … … 319 305 * @param pcbWritten Where to store the count of bytes actually written. 320 306 */ 321 static int TCPNAME(ops_Write)( PLIBCFH pFH, int fh, const void *pvBuf, size_t cbWrite, size_t *pcbWritten)322 { 323 LIBCLOG_ENTER("pFH=%p:{ iSocket=%d} fh=%dpvBuf=%p cbWrite=%d pcbWritten=%p\n",324 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, fh, pvBuf, cbWrite, (void *)pcbWritten);307 static int TCPNAME(ops_Write)(__LIBC_PFH pFH, const void *pvBuf, size_t cbWrite, size_t *pcbWritten) 308 { 309 LIBCLOG_ENTER("pFH=%p:{.iSocket=%d .fh=%d} pvBuf=%p cbWrite=%d pcbWritten=%p\n", 310 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, pFH->fh, pvBuf, cbWrite, (void *)pcbWritten); 325 311 PLIBCSOCKETFH pSocketFH = (PLIBCSOCKETFH)pFH; 326 312 int rc; … … 354 340 * value will be closed. 355 341 */ 356 static int TCPNAME(ops_Duplicate)( PLIBCFH pFH, int fh, int *pfhNew)342 static int TCPNAME(ops_Duplicate)(__LIBC_PFH pFH, int *pfhNew) 357 343 { 358 344 PLIBCSOCKETFH pFHSocket = (PLIBCSOCKETFH)pFH; 359 LIBCLOG_ENTER("pFH=%p:{ iSocket=%d} fh=%d pfhNew=%p\n", (void *)pFH, pFHSocket->iSocket,fh, (void *)pfhNew);345 LIBCLOG_ENTER("pFH=%p:{.iSocket=%d .fh=%d} pfhNew=%p\n", (void *)pFH, pFHSocket->iSocket, pFH->fh, (void *)pfhNew); 360 346 361 347 /* … … 389 375 * returned to the caller. 390 376 */ 391 static int TCPNAME(ops_FileControl)( PLIBCFH pFH, int fh, int iRequest, int iArg, int *prc)392 { 393 LIBCLOG_ENTER("pFH=%p:{ iSocket=%d} fh=%diRequest=%#x iArg=%#x prc=%p\n",394 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, fh, iRequest, iArg, (void *)prc);377 static int TCPNAME(ops_FileControl)(__LIBC_PFH pFH, int iRequest, int iArg, int *prc) 378 { 379 LIBCLOG_ENTER("pFH=%p:{.iSocket=%d .fh=%d} iRequest=%#x iArg=%#x prc=%p\n", 380 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, pFH->fh, iRequest, iArg, (void *)prc); 395 381 int rc; 396 382 … … 407 393 case F_GETFD: 408 394 case F_SETFD: 409 rc = __libc_Back_ioFileControlStandard(pFH, fh,iRequest, iArg, prc);395 rc = __libc_Back_ioFileControlStandard(pFH, iRequest, iArg, prc); 410 396 break; 411 397 … … 422 408 if (!rc) 423 409 { 424 rc = __libc_Back_ioFileControlStandard(pFH, fh,iRequest, iArg, prc);410 rc = __libc_Back_ioFileControlStandard(pFH, iRequest, iArg, prc); 425 411 if (rc) 426 412 { … … 432 418 } 433 419 else 434 rc = __libc_Back_ioFileControlStandard(pFH, fh,iRequest, iArg, prc);420 rc = __libc_Back_ioFileControlStandard(pFH, iRequest, iArg, prc); 435 421 break; 436 422 } … … 459 445 * returned to the caller. 460 446 */ 461 static int TCPNAME(ops_IOControl)( PLIBCFH pFH, int fh, int iIOControl, int iArg, int *prc)462 { 463 LIBCLOG_ENTER("pFH=%p:{ iSocket=%d} fh=%diIOControl=%#x iArg=%#x prc=%p\n",464 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, fh, iIOControl, iArg, (void *)prc);447 static int TCPNAME(ops_IOControl)(__LIBC_PFH pFH, int iIOControl, int iArg, int *prc) 448 { 449 LIBCLOG_ENTER("pFH=%p:{.iSocket=%d .fh=%d} iIOControl=%#x iArg=%#x prc=%p\n", 450 (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, pFH->fh, iIOControl, iArg, (void *)prc); 465 451 PLIBCSOCKETFH pSocketFH = (PLIBCSOCKETFH)pFH; 466 452 char *pchArg = (char *)iArg; … … 794 780 * @param enmOperation The fork operation. 795 781 */ 796 static int TCPNAME(ops_ForkChild)(struct __libc_FileHandle *pFH, int fh,__LIBC_PFORKHANDLE pForkHandle, __LIBC_FORKOP enmOperation)797 { 798 LIBCLOG_ENTER("pFH=%p:{ iSocket=%d} fh=%d\n", (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket,fh);782 static int TCPNAME(ops_ForkChild)(struct __libc_FileHandle *pFH, __LIBC_PFORKHANDLE pForkHandle, __LIBC_FORKOP enmOperation) 783 { 784 LIBCLOG_ENTER("pFH=%p:{.iSocket=%d .fh=%d}\n", (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, pFH->fh); 799 785 PLIBCSOCKETFH pSocketFH = (PLIBCSOCKETFH)pFH; 800 786 int rc = __libc_spmSocketRef(pSocketFH->iSocket); … … 853 839 { 854 840 LIBCLOG_ENTER("iSocket=%d\n", iSocket); 855 PLIBCFH pFHLibc;841 __LIBC_PFH pFHLibc; 856 842 int rc = __libc_FHAllocate(sizeof(LIBCSOCKETFH), &gSocketOps, iSocket, fh, fFlags, &pFHLibc); 857 843 if (!rc) -
trunk/libc/src/kNIX/os2/timebomb.c
r2913 r2916 26 26 27 27 28 #include "libc-alias.h" 29 #include <emx/startup.h> 30 #define INCL_BASE 31 #define INCL_FSMACROS 32 #include <os2emx.h> 28 #include "kNIX.h" 33 29 34 30 #ifdef TIMEBOMB -
trunk/libc/src/kNIX/os2/uflags.c
r2732 r2916 1 1 /* sys/uflags.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include " libc-alias.h"3 #include "kNIX.h" 4 4 #include <sys/uflags.h> 5 5 #include "syscalls.h" -
trunk/libc/src/kNIX/os2/umask.c
r2913 r2916 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include "libc-alias.h" 31 #include "b_fs.h" 32 #include <386/builtin.h> 33 #include <sys/stat.h> 30 #include "kNIX.h" 34 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_IO 35 #include < InnoTekLIBC/logstrict.h>32 #include <klibc/logstrict.h> 36 33 37 34 -
trunk/libc/src/libc/process/nanosleep.c
r2254 r2916 33 33 #include <errno.h> 34 34 #include <sys/limits.h> 35 #include < InnoTekLIBC/backend.h>35 #include <klibc/backend.h> 36 36 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_THREAD 37 #include < InnoTekLIBC/logstrict.h>37 #include <klibc/logstrict.h> 38 38 39 39 … … 65 65 * Convert it all to nanosecond and call the backend. 66 66 */ 67 u nsigned long long ullNanoReq;68 if ( sizeof(pReqTS->tv_sec) < sizeof(u llNanoReq)69 || pReqTS->tv_sec < (U LLONG_MAX / 1000000000))70 u llNanoReq = pReqTS->tv_sec * 1000000000ULL67 uint64_t u64NanoReq; 68 if ( sizeof(pReqTS->tv_sec) < sizeof(u64NanoReq) 69 || pReqTS->tv_sec < (UINT64_MAX / 1000000000)) 70 u64NanoReq = pReqTS->tv_sec * UINT64_C(1000000000) 71 71 + pReqTS->tv_nsec; 72 72 else 73 u llNanoReq = ~0ULL;73 u64NanoReq = ~0ULL; 74 74 75 u nsigned long long ullNanoRem;76 int rc = __libc_Back_threadSleep(u llNanoReq, pRemTS ? &ullNanoRem : NULL);75 uint64_t u64NanoRem; 76 int rc = __libc_Back_threadSleep(u64NanoReq, pRemTS ? &u64NanoRem : NULL); 77 77 if (!rc) 78 78 LIBCLOG_RETURN_INT(0); … … 81 81 && pRemTS) 82 82 { 83 pRemTS->tv_sec = u llNanoRem / 1000000000;84 pRemTS->tv_nsec = u llNanoRem % 1000000000;83 pRemTS->tv_sec = u64NanoRem / 1000000000; 84 pRemTS->tv_nsec = u64NanoRem % 1000000000; 85 85 } 86 86 errno = -rc;
Note:
See TracChangeset
for help on using the changeset viewer.